PrismML has released Ternary Bonsai 2 27B, a ternary-weight version of Qwen3.8 27B. The language model occupies 5.93 GB, against 53.80 GB in FP16. PrismML reports that it keeps 98.2% of the parent model’s average across 20 benchmarks. The model accepts text and images and supports a 262K-token context. PrismML demos it driving Cline coding agents and computer use on an RTX 5090. It arrives 2 months after the first Bonsai 27B, whose ternary variant retained about 95%.
Is it deployable? Yes. The Apache 2.0 weights run today on a 16 GB laptop or a single 24 GB GPU. You need PrismML’s llama.cpp fork or its MLX runtime.
What is Ternary Bonsai 2 27B?
The model keeps the Qwen3.8 27B architecture unchanged. It has 27.36B parameters. That splits into a 24.35B language backbone, 2.54B in embeddings and LM head, and a 0.47B vision tower. The backbone uses hybrid attention, with about 75% linear-attention and 25% full-attention layers.
Ternary weights cover embeddings, attention projections, MLP projections and the LM head. Only 26.2M parameters, or 0.0976%, stay in higher precision. Those are the recurrent state path and normalization weights. In GGUF, the vision tower ships separately as a 0.63 GB file, loaded only for image input.
How Does the Ternary Format Work?
Each weight takes 1 of 3 values: -1, 0 or +1. Every group of 128 weights shares 1 FP16 scale. A ternary value carries log2(3), or about 1.585 bits. Adding 16 scale bits per 128 weights gives 1.71 bits per weight. Counting the high-precision tensors brings the model to 1.72.
Real kernels need a packed layout, so the whitepaper describes 2 GGUF packings. PTQ1_0 packs trits densely at 1.76 bits per weight and 5.93 GB. PQ2_0 stores each trit in a 2-bit slot at 7.25 GB, which is cheaper to unpack.
Weights are also stored in a rotated basis. PrismML applies a blockwise Hadamard rotation with block size 1,024 before ternary assignment. The runtime applies the matching transform to activations before each multiply. The whitepaper cites SpinQuant for this idea. PrismML does not publish how it assigns the ternary values.
/* ———- 2 ternary ———- */
var W=[],isT=false,grid=$(‘#grid’);
function randn(){var u=0,v=0;while(!u)u=Math.random();while(!v)v=Math.random();return Math.sqrt(-2*Math.log(u))*Math.cos(2*Math.PI*v)}
function mix(a,b,t){return ‘rgb(‘+[0,1,2].map(function(i){return Math.round(a[i]+(b[i]-a[i])*t)}).join(‘,’)+’)’}
var CN=[155,133,136],CZ=[245,243,239],CP=[44,49,56];
function colFP(w){var t=Math.max(-1,Math.min(1,w/2.2));return t<0?mix(CZ,CN,-t):mix(CZ,CP,t)}
function colT(t){return t<0?’rgb(155,133,136)’:t>0?’rgb(44,49,56)’:’rgb(245,243,239)’}
for(var i=0;i<128;i++){var c=document.createElement(‘div’);c.className=”cell”;grid.appendChild(c)}
var cells=$$(‘.cell’);
function legend(){
$(‘#legend’).innerHTML=isT
?’-10+1Each cell now needs about 1.585 bits.‘
:’negative to positive, 16 bits each‘;
}
function newW(){W=[];for(var i=0;i<128;i++)W.push(randn());isT=false;paintFP()}
function paintFP(){
cells.forEach(function(c,i){c.style.transitionDelay=’0ms’;c.style.backgroundColor=colFP(W[i])});
$(‘#tScale’).textContent=”n/a”;$(‘#tCount’).textContent=”n/a”;$(‘#tBits’).textContent=”2,048″;$(‘#tBpw’).textContent=”16.00″;
$(‘#ternBtn’).textContent=”Ternarize this group”;legend();
}
function ternarize(){
var m=0;W.forEach(function(w){m+=Math.abs(w)});m/=128;var th=0.7*m,s=0,k=0,cn=[0,0,0];
var T=W.map(function(w){var t=Math.abs(w)>th?(w>0?1:-1):0;if(t){s+=Math.abs(w);k++}cn[t+1]++;return t});
s=k?s/k:0;isT=true;
cells.forEach(function(c,i){
var d=RM?0:(i%16)*18+Math.floor(i/16)*28;c.style.transitionDelay=d+’ms’;c.style.backgroundColor=colT(T[i]);
if(!RM){setTimeout(function(){c.classList.add(‘pop’)},d);setTimeout(function(){c.classList.remove(‘pop’)},d+220)}
});
$(‘#tScale’).textContent=s.toFixed(3);$(‘#tCount’).textContent=cn[0]+’ / ‘+cn[1]+’ / ‘+cn[2];
var bits=128*Math.log(3)/Math.LN2+16;
$(‘#tBits’).textContent=”2048″;count($(‘#tBits’),bits,1,900);$(‘#tBpw’).textContent=”16.00″;count($(‘#tBpw’),bits/128,2,900);
$(‘#ternBtn’).textContent=”Back to FP16″;legend();
}
$(‘#ternBtn’).addEventListener(‘click’,function(){if(isT){isT=false;paintFP()}else ternarize()});
$(‘#ternNew’).addEventListener(‘click’,newW);
var GS=[32,64,128,256];
function renderEq(){
var g=GS[+$(‘#gRange’).value],b=Math.log(3)/Math.LN2+16/g;
$(‘#gOut’).textContent=”g = “+g+(g===128?’ (shipped)’:”);
$(‘#eq’).innerHTML=’bits per weight = log2(3) + 16 / ‘+g+’ = 1.585 + ‘+(16/g).toFixed(3)+’ = ‘+b.toFixed(2)+’ FP16 / this = ‘+(16/b).toFixed(1)+’x‘;
}
$(‘#gRange’).addEventListener(‘input’,renderEq);
/* ———- 3 rotation ———- */
var X=[],S=[],hot=5,rot=false,bars=$(‘#bars’),SC=3.2;
for(var j=0;j<16;j++){(function(j){var w=document.createElement(‘div’);w.className=”bw”;w.title=”Put the outlier here”;var b=document.createElement(‘div’);b.className=”bar”;w.appendChild(b);
w.addEventListener(‘click’,function(){hot=j;mkVec(false)});bars.appendChild(w)})(j)}
function mkVec(newNoise){
if(newNoise||!X.base){X.base=[];S=[];for(var i=0;i<16;i++){X.base.push(randn()*0.16);S.push(Math.random()<.5?-1:1)}}
rot=false;draw();
}
function fwht(a){a=a.slice();for(var h=1;h<16;h*=2)for(var i=0;i<16;i+=h*2)for(var k=i;k=0){b.style.bottom=’50%’;b.style.top=’auto’}else{b.style.top=’50%’;b.style.bottom=’auto’}
b.className=”bar”+(val<0?’ neg’:”)+(!rot&&i===hot?’ hot’:”);
});
var rms=Math.sqrt(en/16);
count($(‘#rPeak’),pk,2);count($(‘#rPar’),pk/rms,1);$(‘#rEn’).textContent=en.toFixed(2);
$(‘#rState’).textContent=rot?’Rotated’:’Original’;$(‘#rotBtn’).textContent=rot?’Undo rotation’:’Rotate’;
}
$(‘#rotBtn’).addEventListener(‘click’,function(){rot=!rot;draw()});
$(‘#rotNew’).addEventListener(‘click’,function(){hot=Math.floor(Math.random()*16);mkVec(true)});
/* ———- 4 scores (whitepaper Tables 7, 8 and Section 4) ———- */
var CAT=[
{n:’Overall’,rows:[[‘Qwen3.6 27B, FP16’,83.6],[‘Qwen3.8 27B, FP16’,85.4],[‘Qwen3.8 27B IQ2_XXS, 7.3 GB’,75.2,’iq’],[‘Ternary Bonsai 2 27B, 5.93 GB’,83.9,’me’]],base:85.4,me:83.9,note:’Average of 20 benchmarks. The conventional IQ2_XXS build is 1.23x larger than Bonsai 2 and scores 8.7 points lower.’},
{n:’Knowledge and reasoning’,rows:[[‘Qwen3.6 27B’,84.71],[‘Qwen3.8 27B’,86.66],[‘Ternary Bonsai 2 27B’,83.95,’me’]],base:86.66,me:83.95,note:’MMLU-Redux, GPQA Diamond, AA-LCR. This is one of the 2 largest gaps in the suite.’},
{n:’Math’,rows:[[‘Qwen3.6 27B’,94.64],[‘Qwen3.8 27B’,97.06],[‘Ternary Bonsai 2 27B’,96.57,’me’]],base:97.06,me:96.57,note:’AIME26, AIME25, GSM8K, MATH-500. Bonsai 2 scores 95.83 on AIME26, above the FP16 baseline at 94.58.’},
{n:’Coding’,rows:[[‘Qwen3.6 27B’,82.57],[‘Qwen3.8 27B’,82.17],[‘Ternary Bonsai 2 27B’,81.58,’me’]],base:82.17,me:81.58,note:’HumanEval+, LiveCodeBench v6, MBPP+, BigCodeBench. LiveCodeBench v6: 90.07 vs 90.05 for FP16.’},
{n:’Agentic and tool calling’,rows:[[‘Qwen3.6 27B’,80.05],[‘Qwen3.8 27B’,79.74],[‘Ternary Bonsai 2 27B’,77.57,’me’]],base:79.74,me:77.57,note:’tau2-Bench and BFCL v3. tau2-Bench reaches 80.22, up from 73.6 in the first Bonsai 27B release.’},
{n:’Instruction following’,rows:[[‘Qwen3.6 27B’,74.53],[‘Qwen3.8 27B’,81.25],[‘Ternary Bonsai 2 27B’,82.66,’me’]],base:81.25,me:82.66,note:’IFEval and IFBench. The only category where the ternary model edges past its FP16 parent.’},
{n:’Vision’,rows:[[‘Qwen3.6 27B’,79.82],[‘Qwen3.8 27B’,81.64],[‘Ternary Bonsai 2 27B’,78.59,’me’]],base:81.64,me:78.59,note:’CharXiv, A-OKVQA, OmniDocBench v1.6, RealWorldQA, OCRBench v2. The lowest retention of the 6 categories.’},
{n:’Long-horizon agents’,groups:[{t:’Terminal-Bench 2.1′,rows:[[‘Qwen3.8 27B’,69.7],[‘Ternary Bonsai 2 27B’,52.8,’me’]]},{t:’SWE-bench Verified’,rows:[[‘Qwen3.8 27B’,80.6],[‘Ternary Bonsai 2 27B’,60.8,’me’]]}],base:80.6,me:60.8,retLabel:’of FP16 kept on SWE-bench Verified (75.8% on Terminal-Bench 2.1)’,note:’These 2 benchmarks sit outside the 20-benchmark average. Retention here is about three quarters, far below the 98.2% headline.’}
];
var ci=0;
CAT.forEach(function(c,k){var b=chip(c.n,k===ci,function(){ci=k;press($(‘#catRow’),b);renderScore()});$(‘#catRow’).appendChild(b)});
function rowsHTML(rows){return rows.map(function(r){return ”}).join(”)}
function renderScore(){
var c=CAT[ci],h=””;
if(c.groups)c.groups.forEach(function(g){h+=’
‘+g.t+’
‘+rowsHTML(g.rows)});else h=rowsHTML(c.rows);
h+=’
0.0%
‘+(c.retLabel||’of Qwen3.8 27B FP16 retained’)+’
‘;
$(‘#scoreCard’).innerHTML=h;$(‘#scoreNote’).textContent=c.note;
var fs=$$(‘#scoreCard .f’);
setTimeout(function(){fs.forEach(function(f,i){f.style.transitionDelay=(RM?0:i*90)+’ms’;f.style.width=f.getAttribute(‘data-w’)+’%’})},30);
count($(‘#retN’),c.me/c.base*100,1,900);postH();
}
/* ———- 5 speed (whitepaper Tables 5, 6) ———- */
var HW=[
[‘RTX 5090 (32 GB)’,[142.5,4121,0.582],[134.4,1901,0.609]],
[‘RTX PRO 6000 Blackwell’,[140.6,4520,0.637],[136.8,2290,0.642]],
[‘H200 SXM (141 GB)’,[118.0,2818,0.708],[89.5,1216,0.814]],
[‘B200 (180 GB)’,[117.1,3112,0.830],[91.9,1406,1.019]],
[‘H100 NVL (94 GB)’,[106.4,2484,0.541],[81.6,1098,0.647]],
[‘H100 SXM (80 GB)’,[103.2,2467,0.584],[77.3,1097,0.706]],
[‘RTX 4090 (24 GB)’,[90.9,3134,0.714],[96.7,1634,0.682]],
[‘RTX 6000 Ada (48 GB)’,[84.8,2430,0.731],[92.0,1627,0.701]],
[‘L40S (48 GB)’,[74.6,2827,0.812],[82.8,1601,0.743]],
[‘A100 SXM (80 GB)’,[74.0,1328,0.776],[54.6,703,0.932]],
[‘L4 (24 GB, 72 W)’,[29.7,778,0.629],[32.1,468,0.585]],
[‘MacBook, M5 Max (Metal)’,[46.8,765,null],null],
[‘MacBook, M5 Pro (Metal)’,[27.7,397,null],[27.1,369,null]],
[‘MacBook, M4 Pro (Metal)’,[18.0,125,null],null]];
var hi=0,pk=0,raf=0;
HW.forEach(function(h,k){var o=document.createElement(‘option’);o.value=k;o.textContent=h[0];$(‘#hwSel’).appendChild(o)});
$(‘#hwSel’).addEventListener(‘change’,function(){hi=+this.value;if(!HW[hi][2])pk=0;renderSpeed()});
$(‘#pkA’).addEventListener(‘click’,function(){pk=0;renderSpeed()});
$(‘#pkB’).addEventListener(‘click’,function(){if(HW[hi][2]){pk=1;renderSpeed()}});
function stop(){if(raf)cancelAnimationFrame(raf);raf=0;$(‘#runBtn’).disabled=false}
function renderSpeed(){
stop();var h=HW[hi],d=h[pk+1];
$(‘#pkA’).setAttribute(‘aria-pressed’,pk===0?’true’:’false’);$(‘#pkB’).setAttribute(‘aria-pressed’,pk===1?’true’:’false’);
$(‘#pkB’).disabled=!h[2];$(‘#pkB’).style.opacity=h[2]?1:.4;
count($(‘#vTg’),d[0],1);count($(‘#vPp’),d[1],0);
if(d[2]==null){$(‘#vE’).textContent=”n/a”;$(‘#vEu’).textContent=””}else{$(‘#vE’).textContent=d[2].toFixed(3);$(‘#vEu’).textContent=”mWh”}
$(‘#vWin’).textContent=!h[2]?’PQ2_0 only’:(h[1][0]>=h[2][0]?’PQ2_0′:’PTQ1_0′);
var n=’Batch size 1, depth 0, no vision tower, llama.cpp with PrismML kernels. ‘;
if(hi>=11)n+=’Apple rows carry no energy figure because powermetrics excludes DRAM power. ‘;
if(hi===13)n+=’The M4 Pro figures come from the earlier pre-rotation build. ‘;
if(hi===11||hi===13)n+=’Only PQ2_0 is reported for this laptop. ‘;
$(‘#spNote’).textContent=n+’PTQ1_0 wins on Ada cards and the L4. PQ2_0 wins on Blackwell, Hopper, Ampere and Apple silicon.’;
$(‘#stream’).innerHTML=”;$(‘#clock’).textContent=”0 tokens, 0.0 s”;postH();
}
$(‘#runBtn’).addEventListener(‘click’,function(){
stop();var rate=HW[hi][pk+1][0],st=$(‘#stream’),made=0,t0=null,DUR=3;st.innerHTML=”;
if(RM){var tot=Math.floor(rate*DUR),fr=document.createDocumentFragment();for(var i=0;i


