Bonsai 27B: a ternary 27B model in 6 GB, the memory math, and the catch

PrismML's Ternary Bonsai 2.5 27B (announced 24 November 2026) stores every weight as −1, 0 or +1: a 5.99 GB file for a model that needs 53.8 GB at 16 bits. What ternary and "1.58 bits" mean, why multiplications could become additions, what it runs on and with which app, the vendor-reported scores, and why it isn't a BitNet.

Ternary Bonsai 2.5 27B is a 27-billion-parameter model in a 5.99 GB file. The same model at 16 bits is 53.8 GB. PrismML announced it on 24 November 2026, under Apache 2.0, and every one of its weights is −1, 0 or +1.

That’s about nine times smaller, and PrismML reports that it keeps most of the full model’s scores. This post covers what “ternary” and “1.58 bits” mean, why people say the multiplications disappear, the memory math, what it runs on, and the catch hidden in PrismML’s own paper.

I didn’t download, run or measure anything for this post. Every number is quoted from PrismML’s announcement, the model card, its whitepapers, Microsoft’s BitNet papers or published file sizes on Hugging Face (all fetched 25 November 2026), or it’s arithmetic on those numbers, and I say so where it is. All benchmark scores and speeds are vendor-reported.

What a ternary weight is

A normal model stores each weight as a 16-bit number, something like 0.0312. A ternary weight can only be one of three values: −1, 0 or +1. Picking one of three choices carries log₂ 3 ≈ 1.585 bits of information, and that’s where the famous “1.58-bit” label comes from.

Three values alone can’t hold a model’s weights, so Bonsai adds a scale. According to the Bonsai 2 whitepaper (2.5 uses the same format), each group of 128 weights shares one 16-bit scale: weight = scale × (−1, 0 or +1). That costs 1.585 + 16/128 ≈ 1.71 bits per weight. The shipped PTQ1_0 file comes to 1.76 bits per weight.

One detail stands out. In Bonsai, even the embeddings and the output head are ternary. PrismML’s July paper points out that most “2-bit” or “4-bit” files keep those tensors, and others, at four to eight bits. Only 26.2 million parameters (0.0976% of the language model: the recurrent-state path of the linear-attention layers and the norms) stay at full precision.

Why multiplications could become additions

A transformer layer mostly multiplies each input by its weight and adds up the results. With ternary weights:

  • weight +1: add the input
  • weight −1: subtract it
  • weight 0: skip it

After that you multiply once by the group’s scale, once per 128 weights. That’s the idea behind Microsoft’s BitNet b1.58 (February 2024), which says “the matrix multiplication of BitNet only involves integer addition”. It also uses 8-bit activations. The paper estimates that this saves “71.4 times arithmetic operations energy consumption for matrix multiplication on 7nm chips”.

Hold that thought, because Bonsai doesn’t do it this way on GPUs (see the catch below).

The memory math (our arithmetic)

The model card lists 24.35B language parameters plus 2.54B embedding/head parameters, so 26.9B language-model weights (the 0.47B vision tower is a separate, optional file).

16-bit26.9B × 2 bytes16-bit: 53.80 GB53.80 GBQ8_0 GGUFUnsloth, same baseQ8_0 GGUF: 29.05 GB29.05 GBQ4_K_M GGUFUnsloth, ≈4.9 bitsQ4_K_M GGUF: 16.56 GB16.56 GBUD-IQ1_S GGUFUnsloth, ≈1.8 bitsUD-IQ1_S GGUF: 6.19 GB6.19 GBBonsai PTQ1_0ternary, 1.76 bitsBonsai PTQ1_0: 5.99 GB5.99 GBpure ternarylog₂3 bits, arithmeticpure ternary: 5.33 GB5.33 GB16 GB
Language-model weights only (24.35B + 2.54B embedding/head = 26.9B, from the model card). 16-bit and pure ternary are our arithmetic; the other bars are published file sizes on Hugging Face (prism-ml/Ternary-Bonsai-2.5-27B-GGUF, unsloth/Qwen3.8-27B-GGUF, 25 Nov 2026). Bars to scale. Weights only: the KV cache and the runtime need memory on top.
Format Bits per weight Size Source
16-bit 16 53.8 GB our arithmetic; PrismML says 53.8 GB
UD-Q4_K_M GGUF (Unsloth, same base) ≈4.9 16.56 GB published file
Bonsai Q2_0 (stock llama.cpp) ≈2.3 7.67 GB published file
Bonsai PQ2_0 2.16 7.25 GB published file
Bonsai PTQ1_0 1.76 5.99 GB published file (5.93 GB of weights)
pure ternary, no scales 1.585 5.33 GB our arithmetic

53.8 ÷ 5.99 is about 9×, and the 4-bit file is 2.8× bigger than Bonsai’s.

Size also decides speed. Generating a token streams essentially all the weights from memory once, so PrismML’s July paper bounds the maximum generation rate by “device memory bandwidth divided by the model’s weight footprint”. In the Bonsai 2 paper, PrismML reports that the ternary model on an M5 Pro moves about 201 GB/s of weights at 27.7 tokens per second, “a decode path dominated by memory bandwidth”.

Will it run on your machine?

Here’s PrismML’s own ladder, with every speed vendor-reported and taken from the 2.5 whitepaper:

Decode speed, tokens per second (vendor-reported)Galaxy S26 UltraNPU, unreleased fixGalaxy S26 Ultra plain: 6.34 tok/s6.34Galaxy S26 Ultra with MTP: 8.79 tok/s8.79Core Ultra laptopbuilt-in GPU (SYCL)Core Ultra laptop plain: 11.1 tok/s11.1Core Ultra laptop with MTP: 24.5 tok/s24.5Apple M4 ProMetal, PQ2_0Apple M4 Pro plain: 22.9 tok/s22.9Apple M4 Pro with MTP: 29.2 tok/s29.2RTX 409024 GB, PTQ1_0RTX 4090 plain: 111 tok/s111RTX 4090 with MTP: 204 tok/s204H200PTQ1_0H200 plain: 194 tok/s194H200 with MTP: 306 tok/s306plain decodingwith the MTP draft head
PrismML's numbers, not ours: Bonsai 2.5 whitepaper Table 6 (llama-server on 36 real prompts; the phone on 10, the M4 Pro on 18; MTP column includes the kernels in testing). Galaxy S26 Ultra runs the Q2_0 file with a Hexagon fix not yet released. Bars to scale.
  • Phone: a Galaxy S26 Ultra ran the Q2_0 file entirely on its Hexagon NPU at 6.34 tokens/s, or 8.79 with the draft head, “with a fix not yet released”. For iPhones, PrismML’s July paper notes that “iOS limits any single app to roughly half of physical memory, so a 12 GB iPhone exposes only about 6 GB”. The ternary file alone is about 6 GB, so it doesn’t leave room. The model that ran on an iPhone in July was PrismML’s 1-bit (binary) 27B, a different 3.9 GB model.
  • 16 GB laptop: PrismML writes that on “a laptop with 16GB of RAM, the full-precision baseline (54 GB) and even Q4_K_XL (17.6 GB) do not fit”, while both ternary packings do. On an Intel Core Ultra laptop’s built-in GPU it reports 11.1 tokens/s, 23.1 with the draft head, and 24.5 with kernels still in testing.
  • Mac: 30.2 tokens/s on an Apple M5 Pro (llama.cpp, Metal, PQ2_0 file). The MLX build does 21.7 on the same machine.
  • Gaming GPU: 112 tokens/s on an RTX 4090 with plain decoding, and about 204 with the multi-token-prediction (MTP) draft head that ships inside every 2.5 GGUF file.

Context costs memory on every rung (the KV cache). The Bonsai-demo README gives the KV cache as 64 KiB per token at 16 bits. By our arithmetic, 32K tokens add about 2.1 GB, and the full 262,144-token context adds about 17.2 GB, almost three times the weights. The demo’s 4-bit KV option (about 18 KiB per token) brings the full context down to about 4.8 GB. Its scripts pick a RAM-tiered context by default, from 8K on small machines up to 131K on machines with more than 71 GB.

Which app runs it

Runtime Status (as documented, 25 Nov 2026)
PrismML’s llama.cpp fork runs PTQ1_0 and PQ2_0, plus the MTP draft head
stock llama.cpp runs the Q2_0 file from release b11556 onward
MLX (Apple Silicon) text-only 2-bit pack, 8.6 GB
LM Studio “bundles its own llama.cpp and MLX engines”: depends on that engine’s version
Ollama not covered by PrismML’s docs
bitnet.cpp not listed; its supported models are native BitNet models

Here’s the trap the model card warns about: “Older stock builds load Q2_0 without any warning and produce garbage.” Check llama-cli --version first. Two more notes from the card: the default reasoning effort is xhigh, and “low reasoning effort is not supported and when selected the model will behave close to xhigh”. It also asks for -n 16384 so the thinking trace isn’t cut off, and --min-p 0. If GGUF names like Q4_K_M are new to you, my GGUF explainer decodes them.

The scores (vendor-reported)

PrismML ran everything in thinking mode at xhigh, pass@1, with all models served through vLLM on H100s:

Benchmark Qwen3.8-27B 16-bit (53.8 GB) Bonsai 2 27B Bonsai 2.5 27B (5.93 GB)
Tool calling, average of 5 77.7 67.0 77.2
SWE-bench Verified 80.6 60.8 75.6
Terminal-Bench 2.1 70.8 52.8 60.1
DeepSWE 30.1 0.0 27.0
Agentic coding, average of 3 60.5 37.9 54.2
General, 5 categories 84.3 81.6 82.1

The jump from Bonsai 2 is the story: the same size and the same format went from zero DeepSWE tasks to 27.0. PrismML’s own limitations section says Terminal-Bench 2.1 “is still the agentic benchmark where we are furthest from FP16”. On Hacker News, many commenters said they’d wait for independent tests, which is fair for any vendor table.

The catch: three myths

Myth 1: it’s a BitNet. BitNet trains ternary models from scratch. Microsoft’s open BitNet b1.58 2B4T has 2 billion parameters, trained on 4 trillion tokens. PrismML says it “takes the opposite path from BitNet: it starts from an off-the-shelf pretrained model and moves it into a binary or ternary representation”. Here that model is Qwen3.8-27B. PrismML calls the conversion method “proprietary Caltech intellectual property”; the papers describe the format, not the recipe.

Myth 2: nothing else that size fits in 6 GB. Unsloth publishes a UD-IQ1_S GGUF of the same Qwen3.8-27B at 6.19 GB. PrismML’s comparison tables use bigger 2- and 3-bit builds (7.6 to 10.1 GB) and don’t include it. I have no quality numbers for it, so this is about size only. PrismML does make a fair point about labels: those “2-bit” files really use 2.27 to 2.75 bits per weight.

Myth 3: no multiplications. This is the line from the Bonsai 2 paper: “The CUDA backend uses fused low-bit GEMM kernels that unpack ternary codes and apply group-wise scales inside the matrix multiply. Activations and numerically sensitive operations remain in higher precision.” So on GPUs it’s an ordinary matrix multiply that reads far fewer bytes. The speed comes from memory traffic, not from skipping multiplications. The 2.5 paper does describe an exact integer kernel for Apple GPUs, but it’s opt-in “because float accumulation order differs”.

Takeaway

Bonsai 27B goes from 54 GB to 6 GB. The weights really are ternary, but it’s a converted model, it runs ordinary multiplies, and it moves far fewer bytes per token. If you have a 16 GB laptop and want a 27B-class model, it’s the smallest documented option, as long as you use a llama.cpp build from b11556 or newer and keep the context sane.

The video version is on the channel (in the “AI, explained with real numbers” playlist). What’s the biggest model your machine runs today?

Sources (fetched 25 November 2026): PrismML announcement; model card and files; MLX pack; whitepapers for Bonsai 2.5, Bonsai 2 and Bonsai 27B; Bonsai-demo; PrismML docs, LM Studio; Ma et al., arXiv:2402.17764 and arXiv:2504.12285; bitnet.cpp; Unsloth Qwen3.8-27B GGUF.