A 4-bit NVFP4 quantization of Ling-3.0-flash,
produced with qstream. The routed MoE experts
(~95% of the weights) are quantized to NVFP4; everything quality-sensitive stays BF16.
plus the unquantized.py patch in vllm_patch/. Why each is needed:
marlin is the only MoE backend supporting weight-only NVFP4A16. triton is
rejected outright; cutlass and flashinfer_cutlass reject the scheme
(QuantKey(u8,scale(f8e4m3fn,...))).
The patch exists because moe_backend is a single global setting, while this
checkpoint has two MoE kinds: NVFP4 routed experts (need marlin) and the BF16 MTP
layer (marlin has no unquantized kernel → moe_backend='marlin' is not supported for unquantized MoE). The patch routes unquantized MoE to Triton, mirroring the
existing humming precedent. Triton also avoids FlashInfer TRT-LLM's grouped-routing
kernel, which is warp-limited to 32 experts per group — Ling-3.0 has 64 (512
experts / 8 groups) and either crashes there or silently mis-routes.
--max-num-seqs 256 — the BF16 MTP head takes ~6 GB, shrinking the KDA state
cache below the default 1024 sequences, so CUDA graph capture aborts with
max_num_seqs (1024) exceeds available Mamba cache blocks (684).
Acceptance by draft position (conditional): 94.3% / 57.2% / 39.7%. The falloff is
expected — Ling-3.0 has a single MTP layer re-run per speculative token — so
num_speculative_tokens: 2 may beat 3 on net throughput. MTP also roughly doubles cold
start: the draft loader re-reads the whole checkpoint to extract one layer.
With all of the above, graph capture succeeds and --enforce-eager is not needed.
If you served this checkpoint before 2026-08-05, re-pull config.json — the earlier
one let the layer-agnostic targets regex claim the MTP layer's BF16 experts as NVFP4,
giving a silently broken drafter (0% acceptance, no error).
Most people should take the MXFP4 build instead.
NVFP4 reconstructs the weights substantially more faithfully, and that advantage does not
show up downstream:
Both GSM8K gaps are under 1.2σ — the two builds are statistically indistinguishable on
this benchmark despite NVFP4's much lower weight error. At this magnitude, 4-bit
reconstruction error is already below what GSM8K can resolve. NVFP4 is published for
comparison and for anyone wanting the more faithful weights (e.g. for longer-generation
or harder tasks where the difference may still surface); MXFP4 is the smaller, better-
tested release.
the KDA gating projections feed a softplus/sigmoid decay gate and are the most precision-sensitive tensors in the model
Router gate + expert_bias, dense MLP (layers 0–1)
BF16
routing decisions are discrete; a perturbed router changes which experts fire
MTP layer 42 (incl. its own 512 experts)
BF16
speculative-decoding draft path — see the MTP warning above
Embeddings, lm_head, all norms
BF16
unchanged
61,440 tensors quantized (40 layers × 512 experts × 3 projections), each with a packed
weight, an FP8-E4M3 group scale and a per-tensor global scale.
Fidelity
Weight-reconstruction relative error, 960-tensor stratified sample (24 per layer, expert
ids strided across the full 512 range, all 40 layers):
min
p25
median
p75
p95
max
std
0.086332
0.086459
0.086498
0.086556
0.086652
0.086742
0.000073
NVFP4's worst sampled tensor (0.0867) is better than MXFP4's best (0.1099) — the two
distributions are disjoint. Two effects compound: group 16 rather than 32 halves how many
weights share a scale, and FP8-E4M3 scales are continuous where MXFP4's E8M0 scales are
powers of two, so an MXFP4 block whose ideal scale falls between 2^k and 2^(k+1) must
round and waste up to 2× of range.
Known issues
MTP / speculative decoding: 0% acceptance — see the warning above. Serve without
--speculative-config.
MTP also breaks CUDA graph capture (gdn_attn.py:382 → CUDA error: invalid argument). Without a draft model, capture succeeds and --enforce-eager is not needed.
The MTP draft loader re-reads the entire checkpoint to extract one layer — two
full weight-loading passes of near-identical duration at startup. Costs I/O, not VRAM.
NVFP4 needs qstream ≥ the _prune_ignore fix. Earlier qstream generalised ignore
entries by layer index, so excluding the MTP layer emitted
re:.*layers\.\d+\.mlp\.experts\.\d+\.gate_proj$ — which also ignored the quantized
experts in all 40 other layers. vLLM checks should_ignore_layer before target
matching, so every expert silently resolved to unquantized and the loader tried to
allocate BF16 buffers for ~242 GB of weights (OOM with no useful error). The
config.json in this repo is already correct.
Serving with vLLM
Ling-3.0 (BailingMoeV3ForCausalLM, model_type: bailing_hybrid) needs the vendor fork
inclusionAI/vllm, branch ling_3_0. (The base
model card points at inclusionAI/vllm-ling-v3, which does not exist.) Upstream vLLM has
only BailingMoe / V2 / V2.5.
Required: the MoE clamp patch
Ling-3.0 declares a per-layer clamped SwiGLU (expert_swiglu_limit_list = [0]*35 + [4]*7,
so layers 35–41 clamp at 4). vLLM's compressed-tensors MXFP4/NVFP4 MoE path drops that
clamp: the quant method never reads layer.swiglu_limit, the quant-config builder has no
parameter to receive it, and run_cutlass_moe_mxfp4 calls apply_moe_activation() with no
clamp argument. The result is unclamped SwiGLU on layers 35–41 — the divergence is large,
not marginal (gate=10 gives silu(10)*2 = 20.0 versus silu(4)*2 = 7.84).
Apply the three files in vllm_patch/ over the fork before serving; they
are pure Python, so an editable install needs no rebuild. See
vllm_patch/README.md.
Launch (Docker)
A prebuilt runtime image carrying the fork, both patches and flashinfer-jit-cache.
NVFP4 + MTP requires the nvfp4 tag or newer latest — earlier images lack the
unquantized MoE oracle patch and will fail to start with
moe_backend='marlin' is not supported for unquantized MoE. (The image itself is
model-agnostic and serves both builds; the tag just marks the build that added this.)
Weights are pulled from the Hub, so mount a cache directory on a volume with ≥85 GB
free (without it the download lands in the container's writable layer and will fill
your root filesystem):
Drop --speculative-config to serve without MTP; --kernel-config and
--max-num-seqs 256 are then optional, and --max-model-len can go much higher (32K+).
Add --load-format fastsafetensors for faster weight loading.
--enable-prefix-caching is required for --mamba-cache-mode align to take effect —
without it vLLM silently downgrades the KDA linear-attention state cache to none and
only logs a warning.
Recommended sampling (from the base card): temperature=0.6, top_p=0.95, top_k=20,
with enable_thinking.
Provenance
Built with qstream from the BF16
inclusionAI/Ling-3.0-flash release:
--nvfp4_mse searches neighbouring E4M3 group scales and keeps the minimum-reconstruction-
error one, with γ-weighted activation awareness from post_attention_layernorm.
Evaluation notes
GSM8K figures above are 5-shot over the full 1319-problem test set via /v1/completions
with plain few-shot prompting — a non-thinking protocol. They are not comparable to the
base model's published scores, which are generated with thinking mode + CoT. They exist to
bound quantization damage, not as leaderboard claims.
License
Inherits the MIT license from the base model. This is a derivative (quantized) work of
inclusionAI/Ling-3.0-flash.
We're introducing Ling-3.0-flash, our next-generation native hybrid reasoning model. Operating with 124B total and 5.1B active parameters (~12.4% and ~8.1% of our previous 1T-class flagship Ring-2.6-1T), Ling-3.0-flash matches or outperforms its predecessor across key benchmarks.
Key highlights of the model are summarized below:
Native Hybrid-Linear Architecture: Ling-3.0 adopts a native hybrid linear attention architecture from the very start of pretraining (5:1 alternating stacking of Kimi Delta Attention (KDA) and MLA), upgraded with KDA fine-grained diagonal gating and 1/64 sparse MoE. With 124B total parameters and 5.1B activated parameters, it achieves a synergistic leap in long-context efficiency and computational cost.
Remarkable Efficiency & Performance: Engineered for speed, compute efficiency, and production deployment, Ling-3.0-flash delivers class-defying performance against both larger SOTA competitors and previous-generation flagships. Activating only 5.1B parameters per token, it provides impressive reasoning, instruction following, and long-context capabilities to empower complex agentic workflows in production environments.
Comprehensive Agentic Evolution: Tailored for real-world productivity workflows, the model incorporates 10,000+ interactive training environments to achieve end-to-end closed-loop execution across Coding, General, and Deep Research Agent tasks. It natively integrates the SGLang HiCache + Mooncake hierarchical caching architecture (featuring physical dual-pools and a cluster-shared L3 cache), eliminating redundant recomputation during long-horizon interactions and reducing Time to First Token (TTFT) by 60% to over 80% in long-input scenarios.s the SGLang HiCache + Mooncake hierarchical caching architecture (featuring physical dual-pools and a cluster-shared L3 cache), eliminating redundant recomputation during long-horizon interactions and reducing Time to First Token (TTFT) by 60% to over 80% in long-input scenarios.
Model Overview
The model summary information and architecture diagram are as follows:
Architecture
Hybrid-linear MoE
Parameter Scale
Totoal 124B, Activated 5.1B
Transformer Layers
35 KDA + 7 Gated MLA (5:1)
Number of Dense Layers
2
Number of Routed Experts
512
Number of Shared Experts
1
Number of Activated Experts
8
Attention Heads
32
Hidden Size
2560
Expert Intermediate Size
768
Dense Intermediate Size
6144
Vocabulary Size
157184
Context Training Schedule
8K -> 32K -> 256K
Evaluation
We have conducted a comprehensive evaluation of Ling-3.0-flash across multiple authoritative benchmarks. Ling-3.0-flash performs strongly on representative code/agent benchmarks such as SWE-Bench Pro, SWE-Bench Multilingual, Tau3-banking-AA, MCP-Atlas and SkillsBench, etc. In practice, Ling-3.0-flash delivers a strong user experience across frameworks including Claude Code,Kilo Code,Qwen Code,Hermes Agent,and OpenClaw, etc. Beyond agentic tasks, Ling-3.0-flash also delivers strong performance across general knowledge,mathematical reasoning,instruction following,and long-context understanding.
Thinking mode is enabled by default. Unless otherwise specified, the default parameters for Ling-3.0-flash are as follows: temperature=0.6, top_p=0.95, top_k=20.
SWE-Bench Series:Evaluated using OpenHands as the agent harness with tailored prompts. Decoding uses temperature=0.6, top_p=0.95, max_new_tokens=32K, with a 256K context window.
Terminal-Bench 2.1: Evaluated under the Artificial Analysis (AA) protocol using the default Terminus 2 harness, a unified 2-hour timeout, the provided JSON parser in preserve-thinking mode, and 3 runs per task (mean). Decoding uses temperature=0.6, top_p=1.0, max_new_tokens=32K, with a 256K context window.
MiniAppBench: A 500-task coding benchmark evaluating whether models can turn a single user request into complete, usable interactive HTML apps in real-world application-generation scenarios. Evaluated with temperature=1.0, top_p=1.0, max_tokens=128K.
AntSWEBench: AntSWEBench is an internally used software engineering benchmark that covers mainstream programming languages such as Java, JavaScript, and Python, including various development scenarios like new feature, bug fix, and code refactoring.
Tau3-banking-AA: Aligned with the AA leaderboard, utilizing GPT-5.4-mini (medium reasoning) for both the user simulator and the natural-language assertion judge.
MCP-Atlas: Evaluated on the 500-task public set using the official v1 harness with a 20-turn limit and Gemini-2.5-Pro as the claim-coverage judger.
SkillsBench: Evaluated via kilo-code on 87 tasks (excluding external API-dependent tasks), averaged over 3 runs.
GDPval v2-AA : Evaluated on the public 220-task benchmark using the official Stirrup harness, with a 250-turn limit and a 5-hour timeout.
Search‑agent:For all search‑agent tasks, evaluations are performed using an internal harness. The basic ReAct paradigm is adopted for single-agent evaluation, while a multi-agent setup is employed for BrowseComp. The reported metric is the average pass@1.
WideSearch: Evaluated using the official prompt and the official judge model GPT-4.1 on the corrected version of the dataset.
Draco: Scored based on official rubrics per question, with the final score calculated as the average across all questions using Claude Opus 4.6 as the scoring model.
BrowseComp (Single-Agent): Evaluated using a resume strategy for context management: once the context reaches a 64K-token threshold, the trajectory is summarized, the original history is discarded, and execution is resumed from the summary.
BrowseComp (Multi-Agent): Evaluated on English and ZH Revised datasets using an internal multi-agent search harness based on SearchSwarm/Tongyi DeepResearch, configured with temperature=0.85, top_p=0.95, max_tokens=8K, and main/sub-agent context windows of 128K and 64K, respectively.