> ## Content Index
> Fetch the complete content index at: https://globalfeed.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# How a 27B model fits in 6 GB: how was Ternary Bonsai 2.5 trained?
- URL: https://globalfeed.ai/en/how-a-27b-model-fits-in-6-gb-how-was-ternary-bonsai-2-5-trained/
- Published: 2026-11-25T22:43:56.000Z
- Updated: 2026-11-25T22:43:56.000Z
- Description: PrismML's ternary Bonsai 2.5 shrinks Qwen3.8-27B ninefold; how low-bit storage works, what changed on agent benchmarks and how to run it.
- Author: GlobalFeed Editor
- Tags: Ternary Bonsai, PrismML, Qwen, Open Model, Local AI, dil-en, elle

A 27-billion-parameter language model normally takes 53.8 GB, too big for the memory of most home computers. PrismML shrank the same model to 5.93 GB, and with Ternary Bonsai 2.5 27B, released on November 24, the compressed model now holds up on long agentic work too. Per the [technical report](https://github.com/PrismML-Eng/Bonsai-demo/blob/main/bonsai-2-5-27b-whitepaper.pdf?ref=globalfeed.ai), Bonsai 2.5 averages 77.2 across five tool-calling benchmarks, against 77.7 for the full-size Qwen3.8-27B. It is Apache 2.0 on Hugging Face and runs on an ordinary GPU.

## Why models are so big

A language model is a set of huge tables of numbers. Stored at 16 bits each, 27 billion numbers come to about 54 GB, and because the whole table is read from memory for every new token, a bigger file is also a slower model. The usual fix is quantization: storing each number in 4, 3 or even 2 bits. PrismML's report describes a weak spot of common low-bit builds: they look fine in short chats but can collapse on long multi-step agent tasks. One 2.5-bit build scores 79.5 on a customer-service benchmark but 46.5 on AppWorld, where in about one task in five it writes a long script guessing every API call and marks the task done before seeing any output.

## How ternary numbers work

In Bonsai, almost every number takes one of three values: minus one, zero or plus one. Each group of 128 values shares one 16-bit scale. A three-way value carries about 1.585 bits; with the group scales the [Bonsai 2 report](https://github.com/PrismML-Eng/Bonsai-demo/blob/main/bonsai-2-27b-whitepaper.pdf?ref=globalfeed.ai) puts the cost at about 1.72 bits, and the shipped PTQ1\_0 file at 1.76 bits per value, a ninefold reduction. The values are stored in a fixed Walsh-Hadamard rotated basis, applied in blocks of 1,024, which spreads out extreme values and makes the three-value approximation easier; the runtime applies the matching transform to activations. Since Bonsai 2, a small group of tensors in the linear-attention state path and normalization layers, 0.0976% of the model or 52 MB, stays in full precision.

## How it was trained

Bonsai 2.5 keeps the Qwen3.8-27B hybrid architecture (about 75% linear and 25% full attention, 262K context) and leaves the Bonsai 2 format unchanged. Per [PrismML's announcement](https://prismml.com/news/bonsai-2-5-27b?ref=globalfeed.ai), training focused on agentic coding, multi-turn tool use, fewer turns and tokens per task, and curbing "excessive thinking and repetitive loops." The payoff shows against Bonsai 2, which kept 63% of the full model's coding score and solved no DeepSWE task. Bonsai 2.5 keeps 90%: DeepSWE goes from 0 to 27.0 (full model 30.1), SWE-bench Verified from 60.8 to 75.6, Terminal-Bench 2.1 from 52.8 to 60.1, and AppWorld from 51.2 to 90.5\. The report does not disclose training data, token counts, steps or hardware.

## Results and speed

Against community builds of the same base, the 3-bit IQ3\_XXS, 1.7 times larger, scores 75.3 on tool calling and 55.5 on coding, versus 77.2 and 54.2 for Bonsai. Across general-capability categories Bonsai 2.5 averages 82.1 against 84.3 for full precision, with the largest gap, 3.1 points, on math. Every file now includes a multi-token prediction draft head that speeds decoding 1.5 to 1.8 times on NVIDIA GPUs: 291 tokens per second on one H100 and 204 on an RTX 4090.

## How to try it

The [Bonsai-demo repo](https://github.com/PrismML-Eng/Bonsai-demo?ref=globalfeed.ai) sets everything up with "./setup.sh" and "./scripts/start\_llama\_server.sh". PrismML's llama.cpp fork supports PTQ1\_0 and MTP; the Q2\_0 file runs on stock llama.cpp b11556 or later, and there is an MLX package for Apple devices. The team notes Terminal-Bench 2.1 is still where it trails full precision most, and hours-long multi-window work has not been measured yet.

Sources: [Hugging Face model card](https://huggingface.co/prism-ml/Ternary-Bonsai-2.5-27B-GGUF?ref=globalfeed.ai), [Bonsai 2.5 technical report](https://github.com/PrismML-Eng/Bonsai-demo/blob/main/bonsai-2-5-27b-whitepaper.pdf?ref=globalfeed.ai), [Bonsai 2 technical report](https://github.com/PrismML-Eng/Bonsai-demo/blob/main/bonsai-2-27b-whitepaper.pdf?ref=globalfeed.ai), [PrismML announcement](https://prismml.com/news/bonsai-2-5-27b?ref=globalfeed.ai), [Bonsai-demo repository](https://github.com/PrismML-Eng/Bonsai-demo?ref=globalfeed.ai)