A 27B model in 5.9 GB: the ternary quantization memory ledger, benchmark traps and half-bit precision

27B parameters, 5.9 GB of memory, Apache 2.0. When PrismML released Ternary Bonsai 2.5 27B on 2026-11-24, those three numbers together looked off: the same scale at BF16 takes 54 GB, more than nine times as much. The Decoder added the speed on 2026-11-25: about 204 tokens per second on an RTX 4090 with MTP.

Do not download yet. Where the 5.9 GB goes, and which abilities were traded for it, are more useful numbers than the headline.

The 5.9 GB ledger: three values per weight

Ternary quantization is plain enough: a weight may only be -1, 0 or +1. Its information content is log2(3), about 1.585 bits per weight, not 16. So 27B times 1.585 divided by 8 is 5.35 GB, the theoretical floor. Where do the remaining fractions go? Run this and see.

import math

P = 27_000_000_000

def gib(bpw, overhead_gib=0.16):
    return P * bpw / 8 / (1024 ** 3) + overhead_gib

for bpw, name in ((16, "BF16"), (8, "INT8"), (4, "INT4"), (3, "INT3"), (1.58, "ternary ~log2(3)")):
    print("%-16s %6.2f GiB" % (name, gib(bpw)))

reported = 5.9 * 1000 ** 3 / 1024 ** 3
print("reported 5.9 GB = %.2f GiB" % reported)
print("ternary at 1.585 bit/w = %.2f GiB, delta %.2f GiB (metadata/KV/overhead)" % (gib(math.log2(3)), reported - gib(math.log2(3))))
print("27B x log2(3) bits = %.0f bytes = %.2f GB" % (P * math.log2(3) / 8, P * math.log2(3) / 8 / 1000 ** 3))

Expected output, verified locally:

BF16              50.45 GiB
INT8              25.31 GiB
INT4              12.73 GiB
INT3               9.59 GiB
ternary ~log2(3)   5.13 GiB
reported 5.9 GB = 5.49 GiB
ternary at 1.585 bit/w = 5.14 GiB, delta 0.35 GiB (metadata/KV/overhead)
27B x log2(3) bits = 5349248440 bytes = 5.35 GB

5.9 GB decimal is 5.49 GiB. Subtract the 5.14 GiB theoretical weight store and 0.35 GiB remains: metadata, runtime structures, and the easiest thing to overlook, the KV cache. Remember that 5.9 GB is where the weights live, not the resident set of the process. Long-context KV is extra, and it doubles when the context doubles.

The benchmark table has a counterexample

From the official PrismML whitepaper (Qwen3.8 27B base / Bonsai 2 / Bonsai 2.5):

  • SWE-bench Verified: 80.6 / 60.8 / 75.6
  • Terminal-Bench 2.1: 70.8 / 52.8 / 60.1
  • AppWorld: 93.2 / 51.2 / 90.5
  • tau-cube Bench: 72.8 / 69.1 / 73.9, the one case that beats the base model
  • BigCodeBench: 61.5 / 57.2 / 60.3
  • LiveCodeBench v6: 87.6 / 83.8 / 83.0

Version 2.5 recovers most agentic scores, but LiveCodeBench v6 keeps falling, from 83.8 to 83.0. That counterexample carries more information than the gains.

My reading: the bottleneck in a long agentic task is not recalling the exact signature of an obscure API. It is not getting stuck, not looping, and not burning the token budget on repeated reasoning. PrismML says the same thing in different words: 2.5 finishes in fewer turns with fewer tokens. A compressed model that gives up earlier happens to help on long chains. Single-shot code generation needs precise recall, and quantization loss has nowhere to hide, so the score keeps sliding. Ask whether your task is long-horizon decision making or single-shot precise output, not whether ternary is good.

The speed ledger: MTP is why a consumer card works

Official numbers: on a single H100, 291 tokens per second with MTP and 3,200 tokens per second prompt processing for a 2,000-token prompt. On an RTX 4090, 204 tokens per second and roughly 3,060 tokens per second prompt processing. Runtimes are llama.cpp for NVIDIA and Intel GPUs and MLX for Mac, iPhone and iPad. Weights are Apache 2.0.

One trap here: MTP speed is measured at a particular batch size and decode configuration. When your agent generates a few dozen tokens per step and then waits for a tool, real throughput drops well below that figure. The bottleneck moves from small-model compute to scheduling and tool round trips. Benchmark your own call shape.

Half a bit: precision as a slider

Another paper from the same day is worth reading: arXiv:2611.34402, Any-Rate: Half-Bit Multi-Precision LLM Quantization with Coded Bit-Planes, submitted 2026-11-25, 41 pages and 17 figures. It asks how one checkpoint can serve several precisions to devices with different headroom. Existing multi-precision methods offer only integer bits, leaving large gaps between adjacent settings and severe damage around 2 bits.

Any-Rate serves 2 to 8 bits from one checkpoint in half-bit steps over 2 to 4 bits. The key move restricts some bit-planes to extended Hamming codewords over blocks of eight weights: eight weights share a four-bit information code, so 4 divided by 8 is 0.5 bits per weight. Each row shares one LUT and each precision gets its own target to reduce the loss from shared bit-planes. The reported results: 69 percent of FP16 accuracy at 2 bits, within one point of the best method at 4 bits, decoding about as fast as existing kernels, and up to 27 percent less energy in an LPDDR model at equal accuracy.

Here is where the half bit literally comes from. The following uses only the standard library to build an extended (8,4) Hamming code: 16 codewords, minimum distance 3, one bit flip correctable per block, and only four bits of information stored.

def parity4(v):
    return (v ^ (v >> 1) ^ (v >> 2) ^ (v >> 3)) & 1

def hamming84(nibble):
    d0 = (nibble >> 0) & 1
    d1 = (nibble >> 1) & 1
    d2 = (nibble >> 2) & 1
    d3 = (nibble >> 3) & 1
    p1 = d0 ^ d1 ^ d3
    p2 = d0 ^ d2 ^ d3
    p4 = d1 ^ d2 ^ d3
    p8 = parity4(d0 ^ d1 ^ d2 ^ d3)
    return p1 | (p2 << 1) | (p4 << 2) | (d0 << 3) | (p8 << 4) | (d1 << 5) | (d2 << 6) | (d3 << 7)

codes = [hamming84(n) for n in range(16)]
dmin = min(bin(a ^ b).count("1") for i, a in enumerate(codes) for b in codes[i + 1:])
print("codewords:", len(codes), "unique:", len(set(codes)), "min_distance:", dmin)
print("correction capability:", (dmin - 1) // 2, "bit flip per block")
print("stored bits per block: 4, weights per block: 8, bits per weight: 0.5")
for n in (0, 5, 15):
    code = hamming84(n)
    flipped = code ^ (1 << 3)
    print("nibble", n, "code", format(code, "08b"), "flipped", format(flipped, "08b"),
          "distance_to_original", bin(flipped ^ code).count("1"))

Expected output, verified locally:

codewords: 16 unique: 16 min_distance: 3
correction capability: 1 bit flip per block
stored bits per block: 4, weights per block: 8, bits per weight: 0.5
nibble 0 code 00000000 flipped 00001000 distance_to_original 1
nibble 5 code 01001101 flipped 01000101 distance_to_original 1
nibble 15 code 11101111 flipped 11100111 distance_to_original 1

That is the literal meaning of half a bit: not half a bit per weight, but four bits of information shared by eight weights. The cost is that quantization levels collapse to sixteen, which is why Any-Rate needs a separate optimization target per precision to recover the loss.

Three things before you switch

First, task shape. Long agentic chains, private file handling and always-on local assistants are worth trying. For single-shot precise code generation, run your own regression set before trusting an aggregate SWE-bench score. Second, memory budgeting: add KV cache using the ledger above and check whether the 5.9 GB card is actually enough. Third, license boundaries: the Bonsai weights are Apache 2.0, the Any-Rate repository is something else entirely, and commercial use needs both checked.

One more thread. Qubit reported on 2026-11-25 a different route from a Chinese team: a General Looped Model claiming 94 million parameters take on five billion with 98 percent less weight memory. It recycles weights rather than quantizing them. Both routes answer the same question: to fit a large model into a small device, do you save parameters or save bit width?

Sources: PrismML release page and whitepaper (2026-11-24), The Decoder (2026-11-25), arXiv:2611.34402 (2026-11-25), Qubit (2026-11-25). All code here was written for this post and tested locally; benchmark numbers are quoted from those public materials.

Further reading

Comentarios

Este sitio es solo frontal: sin backend ni cuentas. Los comentarios van a GitHub Issues, Discussions o correo.

Pega esto en el issue o correo para ayudarme a localizar el problema; no incluye nada de lo que escribiste

También:Ver comentarios existentes · Comentarios por correo (sin cuenta de GitHub):278975598@qq.com