Qwen3.8-27B-MATE-4b

MATE 4-bit (4.00 bpw, 16.50 GB) | 24-32 GB VRAM at 32K context

Base: Qwen/Qwen3.8-27B Honkware: MATE Collection: MATE Quants

At a Glance

Spec Value
Base model Qwen/Qwen3.8-27B
Parameters 26.9B hybrid (48 GDN + 16 full-attention layers)
Quantization 4-bit CPTC-TQIR trellis
Effective bpw / Size 4.00 bpw / 16.50 GB
Context scaling Constant-size recurrent GDN state + 4-bit R4KV on 16 attention layers
Min GPU VRAM (32K context) 24-32 GB
Quality (WT-2 PPL / KLD / Top-1) 6.714 (-0.049) / 0.0245 / 94.25%

Which Variant Should I Pick?

Variant Min GPU (32K context) When to Pick
4b (this repo) 24-32 GB Default pick for 32 GB+ GPUs (RTX 5090 / PRO 6000; use 3b on L4 24 GB)
3b 16-24 GB Fits 16-24 GB GPUs (L4 / RTX 4090) with 128K+ context headroom
2b 12-16 GB Fits 12-16 GB GPUs with fastest 27B decode

Memory Breakdown (32K Context)

Component (32K ctx) FP16 KV R4KV (4-bit)
Quantized weights 16.54 GB 16.54 GB
32K attention KV (48 GDN layers use fixed state) 2.00 GB 0.56 GB (saves 1.44 GB)
Total (Weights + 32K KV) 18.54 GB 17.10 GB

Quickstart

One-Command Launch (mate run)

mate run inspects your GPU/RAM, configures KV compression, offload, and speculative decoding automatically, and loads the checkpoint:

pip install mate-llm[hf]
mate run Honkware/Qwen3.8-27B-MATE-4b --ctx 32768
mate run Honkware/Qwen3.8-27B-MATE-4b --ctx 32768 --serve --port 8000

Query the running server via OpenAI (/v1/chat/completions) or Anthropic (/v1/messages, ANTHROPIC_BASE_URL=http://127.0.0.1:8000):

curl http://127.0.0.1:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"Honkware/Qwen3.8-27B-MATE-4b","messages":[{"role":"user","content":"Write a C++20 lock-free ring buffer."}]}'

Python API

from mate import HybridFastDecodeRunner, load_quantized_model

model, tokenizer = load_quantized_model("Honkware/Qwen3.8-27B-MATE-4b")
runner = HybridFastDecodeRunner(model, tokenizer=tokenizer, max_seq_len=32768, kv_mode="r4kv")
out = runner.generate("Explain trellis quantization in two sentences.", max_new_tokens=128)
print(tokenizer.decode(out["token_ids"], skip_special_tokens=True))

Bare-Metal C++20 (mate-serve)

cmake -S mate/csrc/runtime -B build/runtime -DCMAKE_BUILD_TYPE=Release
cmake --build build/runtime -j
./build/runtime/mate-serve --model ./Qwen3.8-27B-MATE-4b --host 127.0.0.1 --port 8000 --max-batch 64 --max-kv-pages 1024

Sampling & Chat Template

Mode Temperature Top-P Top-K Notes
Thinking (<think>) 0.6 0.95 20 Avoid greedy (temperature=0.0) in thinking mode to prevent repetition loops
Non-thinking (/no_think) 0.7 0.80 20 General chat, coding, and tool calls (mate serve parses <think> and <tool_call> natively)

Variants & Benchmarks

Quality is evaluated on wikitext-2-raw-v1:test (seq_len=2048, BF16 ref PPL 6.763).

Variant bpw Size WT-2 PPL KLD Top-1
4b 4.00 16.50 GB 6.714 (-0.049) 0.0245 94.25%
3b 3.00 13.67 GB 6.922 (+0.160) 0.0662 90.03%
2b 2.00 10.84 GB 7.923 (+1.161) 0.2392 81.29%
Architecture & selective precision
  • Selective mixed precision: lm_head, embeddings, and norms stay in BF16/FP16; linear projections use B=64 2D-FWHT + CPTC-TQIR (trellis_depth=10) with sequential GPTAQ asymmetric LDLQ, YAQA 2D Kronecker H_G, JARQ refinement, per-head V-O Hadamard folding (R2), lossless AWQ MLP smoothing, and pure KL scale distillation.
  • Hybrid Gated DeltaNet (GDN) + full-attention execution: 48 recurrent GDN layers run fused conv1d+GDN with L2 state persistence, corrx0 correction, constant-size H2-FP8 state, and O(1) speculative rollback via ReplaySSM tape folding (gdn_treewy_commit).
  • 4-bit rotated KV cache (R4KV) on the 16 full-attention layers with CUDA-graphed trellis_gemv_v3 decode.
Hardware backends
Target Compute Path Notes
NVIDIA Blackwell (sm_120a) Native CUDA (trellis_gemv_v3, r4kv, gdn) Full DP4A, PDL, Stream-K, 128-split R4KV
NVIDIA Ada / Hopper (sm_89 / sm_90) Native CUDA (trellis_gemv_v3, r4kv, gdn) CUDA-Graph decode, 4-bit R4KV, fused conv1d+GDN recurrence
NVIDIA Ampere (sm_80 / sm_86) Native CUDA (trellis_gemv_v3, r4kv, e8_v3) DP4A GEMV and compressed KV
CPU x86-64 / ARM64 (AVX-512 VNNI, AVX2, NEON) Mojo 1.2 / MAX 26.7 ops (mate/libmate.so) Zero libmax.so runtime dependency; optional on CUDA hosts
Bare-metal C++20 runtime mate-serve + libmate_runtime.so Zero-Python mmap, BPE/Unigram, Jinja2, epoll HTTP/SSE
Quantization recipe & reproduction
Field Value
Method CPTC-TQIR trellis quantization with sequential GPTAQ asymmetric LDLQ, YAQA 2D Kronecker H_G, JARQ refinement, per-head V-O Hadamard folding (R2), lossless AWQ MLP smoothing, and pure KL scale distillation (mode="ldlq", 64 x 512 tokens from wikitext-2-raw-v1:train+mate_prose_code_mix, disjoint from wikitext-2-raw-v1:test).
Base model Qwen/Qwen3.8-27B
Bitwidth & precision 4-bit CPTC-TQIR trellis (trellis_depth=10, B=64 2D-FWHT; lm_head, embeddings and norms kept in BF16/FP16)
KV cache runtime 4-bit R4KV + H2-FP8 GDN ReplaySSM
Engine commit mate-llm 1eefedc
Raw results eval.json
# Weight-space MSE CLI command (calibrated LDLQ uses mate.hf.quantize_model(..., mode="ldlq")):
mate quantize Qwen/Qwen3.8-27B -o Qwen3.8-27B-MATE-4b.safetensors --bits 4 --depth 10 --double-hadamard
Downloads last month
410
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Honkware/Qwen3.8-27B-MATE-4b

Base model

Qwen/Qwen3.8-27B
Quantized
(2,040)
this model

Collection including Honkware/Qwen3.8-27B-MATE-4b