🌳 Bonsai-2 27B Frankenlooped (PQ2_0 GGUF)
Bonsai-2 27B Frankenlooped (PQ2_0) is a depth-extended frankenloop model based on Ternary-Bonsai-2-27B. By duplicating 8 core mid-stack reasoning layers (+4B parameters, expanding the backbone from 64 to 72 layers), it merges the extreme memory-efficiency of 2-bit Polar Quantization (PQ2_0) with the deeper reasoning capabilities of cyclic transformer layer duplication.
🧬 Lineage & Motivation
- Base Model: prism-ml/Ternary-Bonsai-2-27B-gguf
- Reference Comparative: mradermacher/Qwen3.8-27B-Uncensored-v3-GGUF
- Architectural Inspiration: DavidAU/Qwen3.8-31B-Looping-Transformer-Ablit-Heretic-ARA-Uncensored
Why this model was created:
While experimenting with prism-ml/Ternary-Bonsai-2-27B-gguf, we noticed the raw ternary format was blindingly fast with negligible VRAM usage, but the vanilla 27B depth felt noticeably more constrained on multi-step reasoning and complex tool selection compared to uncensored merges like mradermacher/Qwen3.8-27B-Uncensored-v3. Taking inspiration from DavidAU's Looping Transformer methodology, we duplicated 4 Billion parameters (+8 transformer blocks) across the mid-stack associative layers (layers 28–35).
The result is a 72-layer frankenloop that bridges the gap: it unlocks deep chain-of-thought density and zero-refusal instruction adherence while maintaining the ultra-compact 7.5 GB footprint of native PQ2_0 Polar Quantization.
⚡ Highlights & Key Specifications
| Specification | Value |
|---|---|
| Model Designation | Bonsai-2 27B Frankenlooped |
| Parameters | ~31 Billion active (27B base + 4B duplicated mid-stack parameters) |
| Layers / Block Count | 72 Layers (64 base layers + 8 looped mid-stack cycles) |
| File Size / VRAM Footprint | ~7.5 GB (Runs comfortably on RTX 3060/4060, Arc B580/B60, Apple Silicon) |
| Quantization Format | PQ2_0 (Polar Quantization 2-bit with Hadamard Transform) |
| Native Context Length | Up to 262,144 tokens (256k context architecture) |
| Recommended Context | 65,536 – 131,072 tokens (-c 65536 / -c 131072) |
| Alignment / Flavor | Uncensored Heretic v2 / Abliterated (refusal-free, non-preachy) |
| Architecture Family | Hybrid Attention / SSM (Qwen 3.5 backbone) (embedding_dim = 5120) |
| Multimodal Support | Vision enabled via Ternary-Bonsai-2-27B-mmproj-F16.gguf |
| Prompt Template | ChatML (<|im_start|> / <|im_end|>) |
📊 Empirical Benchmarks (llama-bench on Intel Arc Pro B60)
[!NOTE] Hardware Environment & Testing Scope: All benchmarks below were empirically measured using the
llama.cpp-prismbranch on an HP Z4 G4 Workstation equipped with an Intel Arc Pro B60 (Battlemage G21, 24GB GDDR6 VRAM) over a PCIe Gen 3 bus. Testing to date has strictly been performed on this B60 workstation; performance on NVIDIA (CUDA/Tensor Cores) or AMD (ROCm) hardware will scale according to their respective matrix and Hadamard transform kernels.
Comparative Benchmark (NGL = 99, 100% GPU Offload)
| Model | Backend / Driver | VRAM Size | Prompt Processing (pp512) | Token Generation (tg64) |
|---|---|---|---|---|
| Bonsai-2 27B Frankenloop (Ours, 72L) | SYCL (oneAPI Level-Zero) | 7.46 GiB | 855.26 t/s | 32.29 t/s |
| Bonsai-2 27B Frankenloop (Ours, 72L) | Vulkan (Mesa coopmat) | 7.46 GiB | 394.28 t/s | 24.27 t/s |
| Vanilla Ternary-Bonsai-2 27B (64L) | SYCL (oneAPI Level-Zero) | 6.70 GiB | 956.42 t/s | 36.43 t/s |
| Vanilla Ternary-Bonsai-2 27B (64L) | Vulkan (Mesa coopmat) | 6.70 GiB | 413.25 t/s | 10.90 t/s |
| Qwen 3.8 27B (Dense Base, Q4) | SYCL (oneAPI Level-Zero) | 15.60 GiB | ~420.00 t/s | ~14.20 t/s |
| Qwen 3.8 27B (Dense Base, Q4) | Vulkan (Mesa coopmat) | 15.60 GiB | ~320.00 t/s | ~13.50 t/s |
Key Benchmark Insights
- Frankenloop Depth vs Throughput:
- Duplicating 8 associative layers (+4B parameters) adds immense multi-step reasoning depth with only an ~11% throughput delta on SYCL (32.3 t/s vs 36.4 t/s).
- PQ2_0 Polar Quant vs Standard Q4:
- Compared to standard dense 27B models at Q4 (e.g. Qwen 3.8 27B at ~14 t/s), our PQ2_0 looped model runs 2.3× faster in generation while taking up less than half the VRAM (7.5 GiB vs 15.6 GiB).
- Massive Context Headroom:
- Because the 27B looped model occupies under 8 GB of VRAM, >15 GB of VRAM remains uncommitted on a 24GB card, easily hosting a 128k context KV cache (
-ctk q4_0 -ctv q4_0) entirely on-chip without spilling into system RAM.
- Because the 27B looped model occupies under 8 GB of VRAM, >15 GB of VRAM remains uncommitted on a 24GB card, easily hosting a 128k context KV cache (
🧠 The Frankenloop Architecture
Standard 27B models terminate at 64 layers. By duplicating 8 layers across the mid-stack reasoning zone (layers 28–35), we introduce a recurrent reasoning cycle before final representation consolidation:
[Input Embedding: 5120 dim]
│
Layers 0 .. 27 (Feature Extraction & Surface Grounding)
│
┌──────> Layers 28 .. 35 (Mid-Stack Abstract Reasoning Cycle)
│ │
└─────── (Looped Recurrence Step: +8 Layers / +4B Params -> 72 Total)
│
Layers 36 .. 71 (Consolidation, Output Projection, LM Head)
│
[Output Logits]
💠 Prism Polar Quantization (PQ2_0)
This model leverages PQ2_0 (Polar Quantization 2-bit) with an integrated Normalized Sylvester-Walsh-Hadamard transform applied to weight tensors (attn_qkv, ffn_down, ffn_up, ffn_gate).
- High Parameter Density: ~4.1 parameters per byte of storage.
- Hardware Acceleration: Highly optimized for Intel Arc XMX DPAS systolic arrays, modern NVIDIA Tensor Cores, and Apple AMX.
- Extreme VRAM Savings: Leaves >14 GB VRAM available on a 24GB card (e.g. Arc Pro B60 or RTX 3090/4090) for full 128k context KV cache (
-ctk q4_0 -ctv q4_0).
👁️ Multimodal Vision Support
The model supports vision and image inputs using the matching multimodal projector:
- Projector File:
Ternary-Bonsai-2-27B-mmproj-F16.gguf(orQ8_0) - Usage: Pass
--mmproj Ternary-Bonsai-2-27B-mmproj-F16.ggufinllama-serverorllama-cli.
🚀 Quickstart with llama.cpp
1. High-Performance API Server (llama-server)
llama-server \
-m Ternary-Bonsai-2-31B-Looping-PQ2_0.gguf \
--mmproj Ternary-Bonsai-2-27B-mmproj-F16.gguf \
-ngl 99 \
-c 65536 \
-np 1 \
--flash-attn auto \
-ctk q4_0 \
-ctv q4_0 \
--port 50000 \
--host 0.0.0.0
2. Interactive CLI
llama-cli \
-m Ternary-Bonsai-2-31B-Looping-PQ2_0.gguf \
-ngl 99 \
-c 32768 \
--flash-attn auto \
-p "<|im_start|>system\nYou are a helpful, direct, uncensored AI assistant.<|im_end|>\n<|im_start|>user\nExplain how mid-stack layer duplication improves reasoning in dense architectures.<|im_end|>\n<|im_start|>assistant\n"
💬 Prompt Template: ChatML
<|im_start|>system
{system_prompt}<|im_end|>
<|im_start|>user
{user_prompt}<|im_end|>
<|im_start|>assistant
{assistant_response}<|im_end|>
Recommended Sampling Parameters
- Temperature:
0.6(conversational / creative) or0.2(coding / precise analysis) - Top-P:
0.9 - Min-P:
0.05 - Repetition Penalty:
1.05
🛡️ Alignment & Content Policy
This model incorporates Heretic v2 abliteration to remove artificial refusals, preachy lecturing, and moralizing guardrails. It answers prompts directly, neutrally, and without lecturing disclaimers.
[!NOTE] The model is intended for advanced research, automated agent workflows, code auditing, and personal AI systems. Users remain solely responsible for output utilization.
🙏 Acknowledgements & Credits
- prism-ml for the original Ternary-Bonsai-2-27B base and pioneering PQ2_0 Polar Quantization.
- DavidAU for the Looping Transformer methodology and architectural insights.
- mradermacher for benchmarks and reference uncensored Qwen variants.
- The
llama.cppandllama.cpp-prismcommunities for making ternary and low-bit matrix multiplication fast on modern GPUs.