Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Ternary Bonsai 2 27B on Apple Silicon

Long-Context Probe, KV-Cache Scaling, and Negative Results for the 20 tok/s Target

Chengyi Xu and Nexora β€” Nexora Research

License: MIT Context: 262k


Executive Summary

PrismML's Ternary Bonsai 2 27B uses end-to-end ternary weights (${-1, 0, +1}$) mapped to a compact 2-bit quantization (PQ2_0, 7.2 GB on disk) while maintaining near-full baseline accuracy on standard coding and reasoning benchmarks.

This repository publishes our experimental evaluation of Bonsai 2 on an Apple M4 Max 64 GB host under native 262,144 token context constraints.

Key Findings & Negative Results

  1. Context Admissibility: The server successfully loaded and prefilled a 260,013-token prompt, retrieving needle sentinels with 100% precision.
  2. Decode Throughput Collapse at Depth:
    • F16 KV Cache: Full-depth decode dropped to 3.37 tok/s (far below the 20 tok/s operational requirement).
    • Symmetric Q4 KV Cache: Decode achieved 5.29 tok/s at 260k tokens.
    • Short Context Baseline: Short-context reasoning (xhigh) ran at 21.87 tok/s.
  3. Conclusion: While Ternary Bonsai 2's PQ2_0 weights fit comfortably within memory, KV-cache memory bandwidth and attention costs on Apple Silicon Metal architectures prevent simultaneous delivery of 262k context and β‰₯ 20 tok/s decode without specialized model kernels or memory layout optimizations.

Repository Contents

ternary-bonsai2-27b-eval/
β”œβ”€β”€ README.md              # Overview and summary of findings
β”œβ”€β”€ CITATION.cff           # Citation metadata
β”œβ”€β”€ LICENSE                # MIT License
β”œβ”€β”€ MANIFEST.json          # Deployment specification and environment metadata
β”œβ”€β”€ RESEARCH.md            # In-depth architectural analysis and literature review
β”œβ”€β”€ bench/
β”‚   β”œβ”€β”€ context_probe.py   # Deterministic long-context probe harness
β”‚   β”œβ”€β”€ test_context_probe.py # Probe unit test suite
β”‚   β”œβ”€β”€ results.jsonl      # Machine-readable per-trial execution log
β”‚   β”œβ”€β”€ context-260k-f16.json # Raw benchmark result (F16 KV)
β”‚   β”œβ”€β”€ context-260k-q4.json  # Raw benchmark result (Q4 KV)
β”‚   β”œβ”€β”€ context-260k-f16-no-think.json # Raw benchmark result (No reasoning)
β”‚   β”œβ”€β”€ xhigh.json         # Raw benchmark result (Short prompt, xhigh reasoning)
β”‚   └── tool_smoke_payload.json # Tool calling smoke test payload
β”œβ”€β”€ deploy/
β”‚   β”œβ”€β”€ start-canary.example.sh # Server launch script template
β”‚   └── local.prism.bonsai2-262k.plist.example # macOS launchd agent template
└── logs/
    β”œβ”€β”€ canary-f16.log     # Sanitized startup and timing log (F16 KV)
    └── canary-q4.log      # Sanitized startup and timing log (Q4 KV)

Reproducing the Context Probe

Run the unit tests:

python3 bench/test_context_probe.py

Run a probe against an active OpenAI-compatible endpoint:

python3 bench/context_probe.py \
  --endpoint http://127.0.0.1:18795/v1 \
  --tokens 260000 \
  --needle "CRITICAL_SENTINEL_ALPHA" \
  --output probe-results.json

Citation

@dataset{xu2026bonsai2eval,
  title  = {Ternary Bonsai 2 27B on Apple Silicon: Long-Context Probe, KV-Cache Scaling and Negative Results for 20 TPS Target},
  author = {Xu, Chengyi and {{Nexora}}},
  year   = {2026},
  month  = oct,
  url    = {https://github.com/chengyixu/ternary-bonsai2-27b-eval}
}

License

MIT License. Copyright (c) 2026 Chengyi Xu and Nexora. Model weights are property of their respective creators (PrismML) and are not distributed in this repository.

Downloads last month
112