prism-ml's Ternary Bonsai 2 2B, a ternary (−1 / 0 / +1) vision-language model built on Qwen3.5-2B, repacked into
mentria-q2g128-v1 safetensors for mentria-engine, a custom WebGPU runtime that runs the model entirely in
your browser. 2 billion parameters in 506 MB, plus a 208 MB vision tower for image input.
Status: the engine runs this model and its outputs match the reference runtime (below), and on 2026-10-28 it was chosen to replace our Qwen3.5-0.8B-mentria on mentria.ai, as the model for phones and the default tier. The website rollout is under way.
| Path | Size | Purpose |
|---|---|---|
bonsai2-2b-q2g128.safetensors |
~506 MB | Language model |
qwen3.5-2b-vl-q4.safetensors |
~208 MB | Vision tower (optional): the stock Qwen3.5-2B tower in Q4_0, the same file as in Qwen3.5-2B-mentria |
tokenizer.json |
~12 MB | Qwen3.5 BPE tokenizer (248,320 vocab) |
tokenizer_config.json |
~16 KB | Special-token IDs, chat-template metadata |
chat_template.jinja |
~8 KB | Standalone chat template |
preprocessor_config.json |
~400 B | Image preprocessing constants |
Each quantized weight is a ternary code (−1, 0 or +1) with one FP16 scale per 128-weight group, about 2.13 bits per weight. The weights are repacked from the upstream GGUF, not re-quantized. Bonsai 2 stores its weights in a Hadamard-rotated basis; the engine applies the matching rotation to each matmul input in f32 (block size 512 on this model), so the rotation is exact.
Teacher-forced golden test against the PrismML llama.cpp reference: 369 / 369 positions agree, zero decisive disagreements. Teacher-forced means both runtimes see the same context at every position and we compare their top-1 token, so one early difference cannot snowball. A decisive disagreement is one where the reference's top two candidates are more than 0.15 probability apart. Greedy output was identical to the reference on all four free-running prompts.
The browser build that mentria.ai serves gives the same predictions, token for token, in Chrome and in Safari, including image turns (29 / 29 identical).
Each Bonsai 2 model was paired with the 4-bit model of about the same download size that mentria.ai served before (our Q4 conversions of Qwen3.5). Both models ran in mentria-engine, on the same questions, scored by the same scripts, under a test plan written before the runs. This model replaces Qwen3.5-0.8B (485 MB against this model's 519 MB, language model plus tokenizer).
Protocol: greedy decoding, thinking off, no system prompt, no repetition penalty, 2,048-token context; dawn.node on an Apple M4 Pro. Differences are Bonsai minus Q4 in points, with 95% bootstrap intervals and an exact McNemar test on the paired answers.
| Benchmark (n) | Q4 Qwen3.5-0.8B | Bonsai 2 2B (this model) | Difference, points (95% CI) | p |
|---|---|---|---|---|
| GSM8K, maths word problems (1,319) | 44.0% | 74.5% | +30.4 (27.5, 33.4) | < 0.001 |
| IFEval, following instructions, prompt-level strict (541) | 45.5% | 67.3% | +21.8 (16.8, 26.8) | < 0.001 |
| MMLU-Redux, knowledge, 20 per subject × 57 subjects (1,140) | 45.4% | 50.6% | +5.2 (1.8, 8.4) | 0.002 |
The site's chat settings (greedy, no repetition penalty). Two judges, Claude Opus 5.5 and Claude Sonnet 5.5, each saw only anonymised pairs of replies, in both orders, and each was scored on its own.
| Opus 5.5 | Sonnet 5.5 | |
|---|---|---|
| Bonsai 2 2B's reply preferred, English / Spanish / Portuguese (BR) / French (523 prompts) | 75.0% (72.2–77.6) | 73.2% (70.6–75.8) |
| Bonsai 2 2B's reply preferred, Japanese (127 prompts) | 65.8% | 68.9% |
| Answers with an invented fact, hard factual suite (350 prompts) | 72.9% vs 72.9% | 75.7% vs 74.3% |
512-token prompt. "Reply" is decode speed; "first word" is the time to the first token.
| Device | Q4 Qwen3.5-0.8B: reply / first word | Bonsai 2 2B: reply / first word |
|---|---|---|
| Mac (Apple M4 Pro), Chrome | 139 tok/s / 0.33 s | 149 tok/s / 0.64 s |
| Mac (Apple M4 Pro), Safari | 13–15 tok/s / 0.55 s | 80–85 tok/s / 0.76 s |
| iPhone, Safari | 7.6 tok/s / 3.2 s | 23.9 tok/s / 5.3 s |
| Android (Mali-G57 GPU), Chrome | 4.9 tok/s / 39.6 s | 2.9 tok/s / 54.0 s |
| Base model | prism-ml/Ternary-Bonsai-2-2B-gguf (built on Qwen/Qwen3.5-2B) |
| Architecture | Qwen3.5 hybrid: 24 layers, 18 Gated-DeltaNet (16 heads) + 6 full-attention (every 4th layer; 8Q / 2KV, head dim 256), hidden 2048, FFN 6144 |
| Quantization | mentria-q2g128-v1: ternary weights, group size 128, FP16 scale per group, Hadamard-rotated basis |
| Vision tower | 24-layer ViT, 1024 hidden, patch 16, spatial merge 2, projects to the 2,048-wide text embeddings |
| Tokenizer | Qwen3.5 BPE, 248,320 vocab |
| License | Apache 2.0 (upstream license preserved) |
Mentria is AI that runs in your browser, with built-in tools, an extensions library and card decks for learning. Add your own extensions and decks. Your data stays private.
bonsai2-2b-q2g128.safetensors 506 MBqwen3.5-2b-vl-q4.safetensors 208 MBprism-ml/Ternary-Bonsai-2-2B-gguf