36 Downloads Updated 4 days ago
ollama run aiconjured/qwen3.8-flash-next-gsq-rco-gguf-mtp
Model tag: qwen38flashnext-iq3s-mtp:latest
Architecture: qwen4exp (Qwen3.8-Flash-Next, hybrid sparse MoE) with an attached MTP (Multi-Token Prediction) draft head for speculative decoding
Total size: ~99 GB on disk (67.8 GB main + 2.8 GB draft sidecar)
Capabilities: tools · thinking · completion · 262K context
License: Qwen Community License 1.0
This model uses the qwen4exp architecture with hyper-connections and a PLE (per-layer n-gram embedding) block — not supported by stock llama.cpp / stock Ollama as of writing. Additionally, the runner used here applies a d2t (draft-to-target) reduced-vocabulary patch for MTP speculative decoding (trims draft output logits to 32,768 entries for faster spec-decode). On a correctly-patched runner the log shows:
qwen4exp MTP using d2t draft-vocab trim (n_vocab_out = 32768)
…followed by spec-decoding accept-rate stats. The qwen4exp architecture itself needs llama.cpp support for the arch (hyper-connections, PLE, native sparse-attention indexer); the d2t trim is an optional speed patch on top.
This is a remix, not an original quant. All credit to the upstream authors:
| Component | Source | Role |
|---|---|---|
| Base weights | Qwen/Qwen3.8-Flash-Next | Original Qwen3.8-Flash-Next model |
| GGUF quant (IQ3_S, GSQ-RCO) | ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF | Mixed-precision imatrix quantization of the base model |
MTP draft head (Ckpt_Q38, 512x1.4B) |
unsloth/Qwen3.8-Flash-Next-GGUF | Official nextn/MTP checkpoint GGUFs |
| Assembly (FROM + DRAFT merge) | This repo | Combined the ISTA IQ3_S main GGUF with the Unsloth MTP draft into one Ollama model |
Qwen3.8-Flash-Next is a preview of the Qwen4 architecture: a very wide but extremely sparse MoE with hybrid (linear-attention/SSM + periodic full attention) layers, native sparse-attention indexing, hyper-connections, and a per-layer n-gram embedding (“PLE”) block. Despite 176.9 B total parameters it activates only ~4–5 B per token, so it runs in roughly the memory footprint of a mid-size dense model — while behaving like a much larger one.
This particular build packages the ISTA DASLab GSQ-RCO IQ3_S quantization as the main model and attaches the Unsloth MTP draft checkpoint via Ollama’s DRAFT directive, enabling speculative decoding through the model’s own nextn head.
| Property | Value |
|---|---|
| Architecture | qwen4exp (“A Preview of the Qwen4 Architecture”) |
| Total parameters | 176.9 B (general.size_label = 512x56B) |
| Layers | 48 |
| Hidden size | 2,560 |
| Vocab | 248,320 |
| Context length | 262,144 |
| Attention heads | 24 Q heads / 2 KV heads (GQA) |
| Head dim (K/V) | 256 / 256 |
| RoPE | base 10,000,000 · dim 64 · sections [11, 11, 10, 0] |
| MoE | 512 experts per layer, 10 routed + 1 shared active per token |
| Expert FFN width | 640 (shared expert: 640) |
| Hybrid attention | full_attention_interval = 4 — 1 full-attention layer per 4, the rest linear/SSM |
| SSM (linear-attn layers) | 16 groups, inner 6,144, state 128, conv kernel 4, time-step rank 48 |
| Sparse attention indexer | full-attn layers only: 4 heads, key_len 128, top_k = 2048 selected tokens |
| Attention compression | compress_ratios = 4× on every 4th layer pattern |
| Hyper-connections | count 4, low-rank 320 (per attn + per FFN branch) |
| PLE block | layer 1 only: n-gram size 3, 8 heads per n-gram, 16 head vocabularies (~20 M entries each), conv kernel 4 |
| RMSNorm eps | 1e-6 |
| Default sampling | temp 1.0 · top_k 20 · top_p 0.95 |
| Tokens | BOS/EOS 248044 · EOS 248046 · pad 248044 (Qwen3.5 tokenizer, GPT-2 BPE) |
| Chat template | includes vision macros, but the vision tower is not included — text-only |
GSQ + RCO is a mixed-precision, imatrix-guided quantization (calibration set calib_qwen3.8-flash-next.tokids, 1,000 chunks, 926 entries). Tensor-level breakdown as shipped in this model (1,223 tensors, 67.78 GB of tensor data):
| Quant | Tensors | Size | Where it’s used |
|---|---|---|---|
| IQ4_NL | 86 | 18.45 GB | ffn_down_exps ×39 layers + ffn_down_shexp ×47 (all expert/shared down-projections except the 9 F16 layers and 1 Q8_0) |
| F16 | 10 | 15.10 GB | sensitive ffn_down_exps kept lossless-ish in layers 1, 8, 10, 12, 13, 20, 21, 30, 36 (+ PLE conv) |
| IQ3_XXS | 34 | 10.92 GB | ffn_gate_exps + ffn_up_exps in 17 layers |
| IQ2_S | 40 | 10.75 GB | ffn_gate_exps + ffn_up_exps in 20 layers (imatrix-selected lowest bits) |
| IQ3_S | 20 | 7.21 GB | ffn_gate_exps + ffn_up_exps in 10 layers; source of the IQ3_S label |
| Q6_K | 129 | 1.88 GB | fused attn_qkv, split attn_k/attn_v, ssm_out, output.weight (LM head) |
| BF16 | 484 | 1.53 GB | hyper-connection weights, router (ffn_gate_inp), indexer, PLE key/value |
| IQ4_XS | 45 | 1.40 GB | token_embd, some shared experts, some attn_q (in 4 layers), and layer-47 expert gate/up |
| Q5_K / Q4_K | 82 | 0.55 GB | shared experts, split attention projections |
| Q8_0 | 1 | ~0.00 GB | layer-47 shared-expert down (ffn_down_shexp) |
| F32 | 292 | ~0.01 GB | norms, SSM scalars/biases |
Notes:
- token_embd = IQ4_XS (337.7 MB), output.weight (LM head) = Q6_K (521.5 MB); total tensor data 67.78 GB.
- Expert tensors are 3-D ([640, 2560, 512]) — all 512 experts fused per projection.
- Router gating, hyper-connections, and the indexer stay BF16; the quantizer’s imatrix chose per-layer expert bit widths — verified layer map:
- Expert gate/up: IQ2_S ×20 layers · IQ3_XXS ×17 · IQ3_S ×10 · IQ4_XS ×1 (layer 47, the last layer, gets the highest expert precision)
- Expert down: IQ4_NL ×39 layers, F16 ×9 layers (verified: 1, 8, 10, 12, 13, 20, 21, 30, 36) — down-projections are kept much higher precision than gate/up
- Shared expert (*_shexp, one per layer): mixed Q4_K/Q5_K/Q6_K/IQ4_XS gate+up · IQ4_NL down ×47, Q8_0 down ×1 (layer 47)
- Attention: the 12 full-attention layers (3, 7, 11, … 47) use split attn_q/k/v (IQ4_XS → Q6_K mix); the 36 linear-attention/SSM layers use fused attn_qkv (mostly Q6_K, some Q5_K)
full_attention_interval = 4).indexer.q_proj/k_proj + norms) and split Q/K/V projections; linear layers carry fused attn_qkv, attn_gate, and the SSM tensors instead.ple_key [2560, 10240], ple_value, ple_conv1d, 3 norms) — the n-gram embedding lookup feeds that layer.Ckpt_Q38 from Unsloth)A standalone single-block nextn model mirroring the main architecture (34 tensors, 3.88 B elements, 2.78 GB, general.size_label = 512x1.4B). Per-tensor quant tally from the file itself:
| Quant | Tensors | Size | Where |
|---|---|---|---|
| Q4_K | 13 | 1.34 GB | draft attention (q/k/o), expert gate/up, nextn.eh_proj, hyper-conn down/inject |
| Q8_0 | 2 | 0.89 GB | ffn_down_exps + ffn_down_shexp (draft keeps down-projections near-lossless) |
| Q6_K | 3 | 0.53 GB | output.weight (248,320-vocab head), attn_v, hc_ffn_down |
| Q5_0 | 3 | 0.01 GB | hc_attn_up, hc_ffn_up, hc_head_up |
| F32/BF16 | 13 | ~0.01 GB | norms, router, indexer q/k, enorm/hnorm |
| Property | Value |
|---|---|
| Block | blk.48 — one MTP layer appended after the 48 base layers |
nextn_predict_layers |
1 |
| Special tensors | blk.48.nextn.eh_proj [5120, 2560] (hidden⊕embedding fusion), enorm, hnorm, hc_head_up/down/norm |
| Draft vocab | Full 248,320 in-file (output.weight [2560, 248320]); the d2t runner patch trims draft output logits to 32,768 at runtime for spec-decode speed |
| Embedding/output | own token_embd (Q4_K) + output.weight (Q6_K) at full 248,320 vocab |
Built with a Modelfile of this shape:
FROM <ISTA IQ3_S main GGUF (2 shards, merged)>
DRAFT <Unsloth Ckpt_Q38 nextn GGUF>
PARAMETER draft_num_predict 1
draft_num_predict 1 — the draft proposes 1 speculative token per step; the target verifies it in the same forward pass. Raise to 2 for slightly more throughput if your accept rate is high (the head is natively trained for 1-token prediction, so 1 is the safe default).libllama.so rebuilt with the d2t patch).ollama run qwen38flashnext-iq3s-mtp:latest
top_k 2048) keeps long-context attention cheap on the full-attn layers.OLLAMA_CONTEXT_LENGTH or /set parameter num_ctx as needed; the model advertises 262K.capabilities: tools, thinking).qwen4exp support will not load this model; the d2t draft-vocab trim is an extra patch that speeds up MTP but is not mandatory.00001-of-00002) was merged during import; blob layout differs from the HF repo file layout.Qwen Team — Qwen3.8-Flash-Next; ISTA DASLab — GSQ-RCO IQ3_S GGUF quantization; Unsloth — Qwen3.8-Flash-Next-GGUF / MTP (nextn) checkpoint; assembled with Ollama
DRAFTspeculative-decoding directive.