What Is a Ternary LLM? How Bonsai's 1.76-Bit Weights Work
Ternary models store each weight as -1, 0 or +1 with shared scales. See how Bonsai 2.5 27B fits in about 6 GB, and where it loses accuracy.
For Engineering and IT

What is a ternary LLM?
A ternary LLM is a language model whose weights, the numbers that make up its "knowledge," are each limited to one of three values: -1, 0, or +1. Normal models store each weight as a detailed decimal number that takes 16 bits of memory. Ternary models need under 2 bits per weight. Prism ML's Ternary Bonsai 2.5 27B, built on Qwen 3.8, uses this trick to shrink a 27-billion-parameter model to about 6 GB, small enough for a single consumer-class GPU.
TL;DR
- A ternary model stores each weight as -1, 0, or +1 instead of a detailed number, which cuts memory use dramatically.
- In Bonsai 2.5, every group of 128 weights shares one scaling number, so the model can still express large and small values. The average works out to 1.76 bits per weight.
- That brings a 27-billion-parameter model down to about 6 GB, roughly one ninth the size of the full-precision original.
- The model also uses hybrid attention (about three quarters lighter linear attention, the rest full attention), handles up to 262,000 tokens of context, and has a draft head that speeds up generation.
- On tool-calling benchmarks it lands close to the full-size model. The biggest losses show up in math, and agentic coding gives up some ground.
- In one creator's hands-on tests, it fixed a real bug and extracted document data well, but failed a messy multilingual handwriting task and invented a detail in a long creative answer.
How do ternary weights actually work?
An AI model is mostly a huge pile of numbers called weights. When you ask a question, the model multiplies your input through those numbers, layer after layer. A typical model stores each weight with 16 bits, which allows very fine distinctions. That precision costs memory. A 27-billion-parameter model at 16 bits is around 54 GB.
Ternary quantization throws most of that precision away. Quantization just means storing numbers with fewer bits. In a ternary model, each weight is only -1, 0, or +1. Think of it as each connection in the model having three settings: push the signal up, push it down, or ignore it.
Three choices need about 1.58 bits each (that is the math: the base-2 logarithm of 3). Bonsai 2.5 averages 1.76 bits per weight. The shared scales and other overhead in the file help explain why the average sits above the theoretical floor.
What does "128 weights share one scale" mean?
If every weight were literally -1, 0, or +1, the model would be far too crude. A weight in one part of the network might need to be strong, and one somewhere else might need to be faint. The fix is a scaling number.
Bonsai splits its weights into groups of 128. Each group gets one scaling number. Every weight in the group is still -1, 0, or +1, but the whole group is multiplied by its shared scale. One group can behave loudly, the next quietly.
A rough analogy: imagine a thermostat with only three buttons (down, hold, up) in each room, and a dial per group of 128 rooms that sets how big each step is. The buttons are simple. The dials give you back some range.
The payoff is storage. Per Bonsai's own summary, this scheme brings the smallest standard file to roughly 6 GB, about nine times smaller than the original full-precision Qwen model.
What else is in Bonsai 2.5's architecture?
Ternary weights are the headline, but the model has several other design choices that matter for everyday use.
- Base model: it is built on Qwen 3.8 and has 27 billion parameters, covering language, vision, and the layers that turn words into numbers and back. That means it can read images as well as text.
- Hybrid attention: attention is how a model decides which earlier words matter for the next one. Full attention is thorough but gets expensive as text grows. About three quarters of Bonsai's layers use a lighter linear attention, and the rest use full attention.
- 262K context: it can handle up to about 262,000 tokens in one session. A token is roughly a word fragment, so that is room for a very long document or a big codebase.
- Built for agents: it is designed for tool use, where the model calls software tools to complete tasks. It offers two reasoning levels, medium and extra high.
- License: it ships under the Apache license, which is permissive for commercial use.
What is a draft head, and why does it speed things up?
Language models write one token at a time, and each step requires a pass through the whole network. That is slow.
A draft head is a small add-on that guesses the next few tokens in advance. The main model then checks those guesses in one go. When the guesses are right, you get several tokens for the price of one check. When they are wrong, the main model corrects them. This technique is often called speculative decoding. The output quality is set by the main model, because it verifies everything. The draft head only affects speed.
How well does a 6 GB model actually perform?
Here is what was reported, split into what the model's makers claim and what one creator saw testing it locally.
Benchmarks. On tool calling, which measures how well a model uses tools to get real tasks done, the full-precision Qwen original (about nine times bigger) and Bonsai 2.5 are almost neck and neck on average. Bonsai 2.5 also beat every other compressed version in the comparison on that average, even though those versions take up more space. Against the earlier Bonsai 2, which is the same size, it is clearly better, with a large jump on AppWorld, a test of whether a model can complete tasks across apps. It does not win every test.
Hands-on tests. A creator ran the model locally, served with the project's own script and llama server, using about 14 GB of VRAM at the context length he chose on a 48 GB workstation GPU. Results were mixed in an instructive way:
| Task | Result |
|---|---|
| Fix a real bug in a full-stack health dashboard (an alert threshold that counted the current spike as "normal") | Passed. Found the bug and made a one-line fix in about 10 minutes, with no looping. |
| Turn an image into a single-file HTML simulation | Average. Took around 15 minutes. Captured the main objects but not a polished result. |
| Math from an image, with a harder follow-up | Passed both parts. |
| Identify languages in a handwritten note and translate a line | Mostly failed. Misnamed languages, quoted a line not on the note, garbled translations. |
| Extract fields from a printed land transfer document into JSON | Passed. All seven fields matched. |
| Long, open-ended advice about a photo of three people | Well written, but invented a doorway scene not in the photo. |
These are one person's informal tests, not a controlled study. They are useful as a pattern, not as proof.
Where does ternary compression lose accuracy?
You do not get a 9x smaller model for free. The paper reportedly says tool calling and general ability lose little. Agentic coding keeps most, but not all, of the original score. The paper's figure is about 90%, though the creator doubted that number from his own experience and guessed lower. Treat it as unsettled and test on your own work.
The largest loss is in math, according to the model's paper. The creator's easy math problems passed, and he expected a very hard one to break the model. That fits a common intuition: multi-step exact reasoning is where small errors in weights compound.
The tests also point to weak spots in:
- Rare or low-resource languages, especially from handwriting.
- Fine visual detail, where it can invent things.
- Long free-form answers, where it can add plausible but false specifics.
If your work is structured (extract these fields, call this tool, fix this function), the trade looks good. If your work needs exact math or faithful reading of messy inputs, check the output.
What does this mean for you?
If you work with sensitive data. A model that runs on one local GPU means documents, customer records, or code never have to leave your machine. Contract extraction, form processing, and internal code review are natural fits. Ask your IT team whether local models are allowed, and which hardware you already have.
If you are a manager or buyer. Small, capable models change the cost math. You may not need to pay per request for every task. A 6 GB model that handles tool calling well could cover the routine work, with a larger hosted model reserved for hard problems.
If you are hands-on and curious. The creator's setup was simple: clone the project's repository, run its setup script (which downloads the model and prerequisites), and serve it with llama server. Pick a task you already do, like pulling fields from a document, and compare the output to what you would trust.
What to do before relying on it:
- Test on 10 to 20 of your own real examples, not demos.
- Spot-check math, names, dates, and anything that must be exact.
- Watch for invented details in long answers.
- Keep a human review step for anything with consequences.
Can you build something useful around a model like this?
A model is only part of a working tool. The example that made the bug test meaningful was a dashboard: twelve clinics reporting weekly case counts, with an alert when a number spikes. If you track weekly numbers at work, such as support tickets, defect counts, or regional sales, you can describe that same kind of tracker to Remy in plain English. Remy builds and deploys a full-stack app with a database and sign-in, and the alert rules live in the spec you can read and edit. It can use hosted AI models without API keys, and it can reach local models over a secure tunnel if you want to keep inference in-house.
Frequently Asked Questions
Is a ternary model the same as a 1-bit model?
Not exactly. True 1-bit models use two values per weight. Ternary adds zero as a third value, which needs about 1.58 bits in theory. Bonsai 2.5 averages 1.76 bits per weight once its shared scales and other overhead are counted, so "1-bit" is a loose label.
Why does Bonsai 2.5 need group scales?
With only -1, 0, and +1, every weight would have the same strength. A shared scaling number per group of 128 weights lets different parts of the network be louder or quieter, which recovers some of the range lost by squeezing the numbers.
Can I run Bonsai 2.5 27B on my own computer?
The file is about 6 GB, and one creator ran it on a 48 GB workstation GPU, where it used about 14 GB of VRAM at his chosen context length. Memory use grows with context length, so your requirements depend on your settings. Check the project's repository for current hardware guidance.
Is it as accurate as the full-size model?
On tool-calling benchmarks it is close on average. Math shows the biggest loss, and agentic coding keeps most but not all of the original score. Results vary by task, so test it on your own work.
What does the 262K context window mean in practice?
It means the model can take in up to about 262,000 tokens at once, enough for very long documents or large sets of files. Longer contexts need more memory, so you may not use the maximum on modest hardware.
Useful for
How we source, write, and correct our articles. Editorial standards



