Ternary Weight Compression: 27B Model Shrunk to 6GB, Runs Locally in the Browser

Ternary Bonsai 2 compresses a 27B model to under 6GB via ternary weight quantization, enabling local browser inference.
Ternary Bonsai 2 is a 27-billion-parameter language model derived from Qwen3.8-27B, whose core innovation is quantizing model weights to three discrete values {-1, 0, +1}. Without changing the original architecture, this reduces the model from ~54GB at FP16 precision to under 6GB — roughly one-ninth the original size. The publisher claims 98.2% performance retention and offers a WebGPU-based browser inference demo, enabling a 27B-scale model to run locally on consumer devices without a server for the first time. The results align with on-device AI and privacy-computing trends, though all key metrics currently come from the publisher and await independent community verification.
How Do You Fit a 27B Model into 6GB?
The open-source community recently saw a release worth paying attention to: Ternary Bonsai 2 (27B) has landed on Hugging Face. Its most striking feature isn't the parameter count — it's the size. The entire model file comes in under 6GB and can even run locally in a browser via WebGPU.
For anyone accustomed to large model deployments that routinely demand tens of gigabytes of VRAM, this number almost feels counterintuitive. A 27-billion-parameter language model typically requires around 54GB of storage at FP16 precision — Ternary Bonsai 2 compresses that down to roughly one-ninth of the original.

What Ternary Weights Actually Do
According to the model card, Ternary Bonsai 2 is derived from Qwen3.8-27B — a causal language model with a hybrid-attention mechanism. The key point: the architecture itself hasn't changed. What changed is how the weights are represented.
Ternary weights means quantizing model weights to just three possible values (typically -1, 0, and +1). Compared to traditional 16-bit floating-point numbers, this extreme quantization approach drastically reduces the storage bits required per weight — which is the direct reason the model can be compressed below 6GB.
This approach didn't come out of nowhere. Ternary and binary network ideas have accumulated years of academic research, and as large model deployment costs have surged in recent years, ultra-low-bit quantization has once again become a hot research topic. The value of Ternary Bonsai 2 lies in applying this approach to a substantial 27B-scale model and making the results publicly available.
How Much Accuracy Is Retained?
The model card claims: size reduced to one-ninth of FP16, while retaining 98.2% of intelligence performance.
If this number holds up in real-world use, it means the performance loss from quantization has been kept remarkably small. The biggest concern with extreme quantization has always been accuracy collapse — compressing continuous floating-point weights into three discrete values can easily cause the model to lose critical information. A 98.2% retention rate, if reliable, suggests that significant compensatory work went into the quantization and training/fine-tuning pipeline.
It's worth noting that this figure comes from the publisher's own model card. Which benchmarks were evaluated and how "intelligence retention" was calculated remain to be independently reproduced and third-party verified.
Ternary weight quantization falls under the category of "Ultra-Low Bit Quantization." Common large model quantization schemes step down from FP16 (16-bit float) to INT8, then INT4, while ternary quantization theoretically requires only about 1.58 bits per weight (log₂3) — making it one of the most aggressively compressed mainstream approaches available. A landmark related work is BitNet b1.58, proposed by Microsoft Research in 2024, which also uses {-1, 0, +1} ternary representation and argues that at sufficient model scale, ternary models can approach full-precision performance in terms of the efficiency-accuracy tradeoff. Another hardware advantage of ternary weights: multiplication by -1, 0, or +1 degrades to addition and sign-flipping operations, which could theoretically reduce power consumption and compute latency on dedicated hardware — a fundamental reason why the research community has maintained long-term interest in these approaches.
What Browser Execution via WebGPU Actually Means
The publisher also provides an online demo based on WebGPU (webml-community/ternary-bonsai-2-webgpu-kernels), demonstrating the model's ability to run inference locally in the browser.
This point deserves more unpacking than just "small file size." WebGPU is the modern web standard for accessing low-level GPU compute capabilities, allowing models to run on a user's device without any server involvement. For a 27B-scale model to achieve in-browser inference means its memory footprint and compute requirements have been compressed to a level that consumer hardware can handle.
Local execution brings several direct benefits: data never leaves the user's device, offering stronger privacy; no inference costs or dependence on cloud APIs; and offline scenarios become viable. This aligns closely with the broader trend toward on-device AI.
WebGPU is a W3C web standard that officially shipped in 2023 and is currently supported in major browsers including Chrome and Edge. Its predecessor WebGL was primarily focused on graphics rendering; WebGPU provides a more low-level general-purpose GPU compute interface (similar to desktop Vulkan/Metal), making it possible to run neural network inference in the browser. WebGPU-based inference frameworks (such as Apache TVM's Web backend and transformers.js) have developed rapidly in recent years and can already support browser-side execution of models ranging from 7B parameters and beyond. That said, WebGPU's real-world performance is subject to multiple constraints — browser sandboxing, driver versions, and GPU model — and running a 27B model on an integrated GPU in a consumer laptop may result in inference speeds far below native local execution environments. Practical usability still depends heavily on specific hardware configuration.
How to Think About This Release
Ternary Bonsai 2 provides a complete set of resources — including the model collection on Hugging Face (prism-ml/bonsai-2) and a directly accessible WebGPU demo — so anyone can verify the claims themselves.
From a technical standpoint, it represents a practical implementation of the "slimming down" direction for large models: keep the architecture intact, use ultra-low-bit quantization to compress a large model into a locally deployable footprint. If community benchmarks can confirm that performance retention comes close to the officially claimed figure, ternary weight models like this could become an important option for on-device deployment and browser-based AI applications.
Of course, all key metrics currently come from the publisher, and the community has yet to form broad independent verification. For practitioners considering real-world use, the rational approach is to test personally through the demo and public weights before deciding whether it fits your use case. Whatever the final verdict, getting a 27B model down to 6GB and running in a browser is, in itself, an engineering effort worth watching.
Related articles

NVIDIA cuML Accelerates Spectral Clustering: 100x+ Speedup Over Scikit-Learn Benchmarked
NVIDIA cuML lets Scikit-Learn spectral clustering run on GPU without code changes, delivering 200x+ speedups on large datasets. Learn how it works and how to use it.

Google DeepMind Launches New Institute to Bring the AGI Debate into the Open
Google DeepMind has launched a new institute to bring AGI debate into the public sphere. We analyze what this signals about the shift from technical competition to AI governance.

How Cooley Is Reinventing IPO Legal Workflows with ChatGPT: A Look at the GO Public Tool
Cooley built GO Public on ChatGPT Work to accelerate IPO legal workflows, helping lawyers catch issues earlier and focus judgment where it matters most.