prism-ml/Ternary-Bonsai-1.7B-mlx-2bit

Model

Ternary-Bonsai-1.7B-mlx-2bit

21

4 commits

3 linked in READMEs

updated Apr 18, 2026

See the code
1.58-bit
apple-silicon
bonsai
conversational
eval-results
on-device
prismml
qwen3
safetensors
ternary
text-generation

README

Bonsai

Prism ML Website  |  White Paper  |  Demo & Examples  |  Discord

Ternary-Bonsai-1.7B-mlx-2bit

Ternary (1.58-bit) language model for Apple Silicon

7.2x smaller than FP16 | 3.8x faster on M4 Pro | 103 tok/s on iPhone | runs on Mac, iPhone, iPad

Highlights

  • 0.45 GiB (0.48 GB) packed 2-bit size (down from 3.44 GB FP16) — fits anywhere
  • Ternary weights {-1, 0, +1} across embeddings, attention projections, MLP projections, and LM head
  • 57.5 avg benchmark score across 6 categories
  • 103 tok/s on iPhone 17 Pro Max
  • MLX-native format with group size 128 and FP16 scaling

Pareto Frontier

Resources

  • White Paper
  • Demo repo — examples for serving, benchmarking, and integrating Bonsai
  • Discord — community support and updates
  • Kernels: MLX (Apple Silicon) · mlx-swift (iOS/macOS) — 2-bit format is supported out of the box

Model Overview

ItemSpecification
Base modelQwen3-1.7B
Parameters1.72B
ArchitectureGQA, SwiGLU MLP, RoPE, RMSNorm
Context length32,768 tokens
Vocab size151,936
Weight formatTernary g128: {-1, 0, +1} with FP16 group-wise scaling
Packed 2-bit size0.45 GiB (0.48 GB)
Ternary coverageEmbeddings, attention projections, MLP projections, LM head
LicenseApache 2.0

Quantization Format: Ternary g128

Each weight takes a value from {-1, 0, +1}, with one shared FP16 scale per group of 128 weights:

w_i = scale_g * t_i,    t_i in {-1, 0, +1}

The information-theoretic cost is log2(3) ≈ 1.585 bits per weight, plus FP16 group scales (16 bits per 128 weights), for a theoretical minimum of ~1.71 bits/weight. This release uses the MLX 2-bit format, which stores each ternary value in 2 bits plus group scales, for an effective ~2.125 bits/weight.

Memory

FormatSizeReductionRatio
FP163.44 GB--1.0x
MLX 2-bit g1280.45 GiB (0.48 GB)86.0%7.2x

Quickstart

MLX (Python)

pip install mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("prism-ml/Ternary-Bonsai-1.7B-mlx-2bit")

response = generate(
    model,
    tokenizer,
    prompt="Explain quantum computing in simple terms.",
    max_tokens=256,
)
print(response)

Throughput (MLX / Apple Silicon)

PlatformBackendPP512 (tok/s)TG128 (tok/s)FP16 TG (tok/s)Speedup
M4 Pro 48 GBMLX (Python)1,764235623.8x

iPhone 17 Pro Max (MLX Swift)

PlatformBackendPP512 (tok/s)TG128 (tok/s)4-bit TG (tok/s)Speedup
iPhone 17 Pro MaxMLX Swift1,456103601.7x

Benchmarks

Evaluated with EvalScope v1.4.2 + vLLM 0.15.1 on NVIDIA H100. Full benchmark suite (10 benchmarks):

ModelSizeAvgMMLU-RMuSRIFEvalGSM8KHE+BFCLv3
Ternary Bonsai 1.7B0.37 GB58.4752.950.870.174.251.851.0
1-bit Bonsai 1.7B (prior)0.24 GB49.6043.245.163.066.345.134.9
Qwen3 1.7B3.44 GB66.5766.850.170.383.157.371.8
Qwen3 0.6B1.19 GB48.0247.541.562.864.130.541.7
LFM2 1.2B2.34 GB46.7352.925.477.562.236.026.4
Gemma3 1B2.00 GB45.5343.237.061.964.440.226.5
Llama 3.2 1B2.47 GB39.8847.229.247.749.035.430.8

Intelligence Density

density = -ln(1 - score/100) / size_GB
ModelSizeIntelligence Density (1/GB)
Ternary Bonsai 1.7B0.37 GB2.389
1-bit Bonsai 1.7B (prior)0.24 GB2.832
Qwen3 0.6B1.19 GB0.549
Qwen3 1.7B3.44 GB0.318
Gemma3 1B2.00 GB0.304
LFM2 1.2B2.34 GB0.269
Llama 3.2 1B2.47 GB0.206

Citation

@techreport{ternarybonsai,
    title   = {Ternary Bonsai: 1.58-bit Language Models at 8B, 4B, and 1.7B Scale},
    author  = {Prism ML},
    year    = {2026},
    month   = {April},
    url     = {https://prismml.com}
}

Contact

For questions, feedback, or collaboration inquiries: contact@prismml.com

Contributors

pashak

3 commits

Sahin-Lale

1 commits

prism-ml/Ternary-Bonsai-1.7B-mlx-2bit

Model

Ternary-Bonsai-1.7B-mlx-2bit

21

4 commits

3 linked in READMEs

updated Apr 18, 2026

See the code
1.58-bit
apple-silicon
bonsai
conversational
eval-results
on-device
prismml
qwen3
safetensors
ternary
text-generation

README

Bonsai

Prism ML Website  |  White Paper  |  Demo & Examples  |  Discord

Ternary-Bonsai-1.7B-mlx-2bit

Ternary (1.58-bit) language model for Apple Silicon

7.2x smaller than FP16 | 3.8x faster on M4 Pro | 103 tok/s on iPhone | runs on Mac, iPhone, iPad

Highlights

  • 0.45 GiB (0.48 GB) packed 2-bit size (down from 3.44 GB FP16) — fits anywhere
  • Ternary weights {-1, 0, +1} across embeddings, attention projections, MLP projections, and LM head
  • 57.5 avg benchmark score across 6 categories
  • 103 tok/s on iPhone 17 Pro Max
  • MLX-native format with group size 128 and FP16 scaling

Pareto Frontier

Resources

  • White Paper
  • Demo repo — examples for serving, benchmarking, and integrating Bonsai
  • Discord — community support and updates
  • Kernels: MLX (Apple Silicon) · mlx-swift (iOS/macOS) — 2-bit format is supported out of the box

Model Overview

ItemSpecification
Base modelQwen3-1.7B
Parameters1.72B
ArchitectureGQA, SwiGLU MLP, RoPE, RMSNorm
Context length32,768 tokens
Vocab size151,936
Weight formatTernary g128: {-1, 0, +1} with FP16 group-wise scaling
Packed 2-bit size0.45 GiB (0.48 GB)
Ternary coverageEmbeddings, attention projections, MLP projections, LM head
LicenseApache 2.0

Quantization Format: Ternary g128

Each weight takes a value from {-1, 0, +1}, with one shared FP16 scale per group of 128 weights:

w_i = scale_g * t_i,    t_i in {-1, 0, +1}

The information-theoretic cost is log2(3) ≈ 1.585 bits per weight, plus FP16 group scales (16 bits per 128 weights), for a theoretical minimum of ~1.71 bits/weight. This release uses the MLX 2-bit format, which stores each ternary value in 2 bits plus group scales, for an effective ~2.125 bits/weight.

Memory

FormatSizeReductionRatio
FP163.44 GB--1.0x
MLX 2-bit g1280.45 GiB (0.48 GB)86.0%7.2x

Quickstart

MLX (Python)

pip install mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("prism-ml/Ternary-Bonsai-1.7B-mlx-2bit")

response = generate(
    model,
    tokenizer,
    prompt="Explain quantum computing in simple terms.",
    max_tokens=256,
)
print(response)

Throughput (MLX / Apple Silicon)

PlatformBackendPP512 (tok/s)TG128 (tok/s)FP16 TG (tok/s)Speedup
M4 Pro 48 GBMLX (Python)1,764235623.8x

iPhone 17 Pro Max (MLX Swift)

PlatformBackendPP512 (tok/s)TG128 (tok/s)4-bit TG (tok/s)Speedup
iPhone 17 Pro MaxMLX Swift1,456103601.7x

Benchmarks

Evaluated with EvalScope v1.4.2 + vLLM 0.15.1 on NVIDIA H100. Full benchmark suite (10 benchmarks):

ModelSizeAvgMMLU-RMuSRIFEvalGSM8KHE+BFCLv3
Ternary Bonsai 1.7B0.37 GB58.4752.950.870.174.251.851.0
1-bit Bonsai 1.7B (prior)0.24 GB49.6043.245.163.066.345.134.9
Qwen3 1.7B3.44 GB66.5766.850.170.383.157.371.8
Qwen3 0.6B1.19 GB48.0247.541.562.864.130.541.7
LFM2 1.2B2.34 GB46.7352.925.477.562.236.026.4
Gemma3 1B2.00 GB45.5343.237.061.964.440.226.5
Llama 3.2 1B2.47 GB39.8847.229.247.749.035.430.8

Intelligence Density

density = -ln(1 - score/100) / size_GB
ModelSizeIntelligence Density (1/GB)
Ternary Bonsai 1.7B0.37 GB2.389
1-bit Bonsai 1.7B (prior)0.24 GB2.832
Qwen3 0.6B1.19 GB0.549
Qwen3 1.7B3.44 GB0.318
Gemma3 1B2.00 GB0.304
LFM2 1.2B2.34 GB0.269
Llama 3.2 1B2.47 GB0.206

Citation

@techreport{ternarybonsai,
    title   = {Ternary Bonsai: 1.58-bit Language Models at 8B, 4B, and 1.7B Scale},
    author  = {Prism ML},
    year    = {2026},
    month   = {April},
    url     = {https://prismml.com}
}

Contact

For questions, feedback, or collaboration inquiries: contact@prismml.com

Contributors

pashak

3 commits

Sahin-Lale

1 commits