Qwen3-0.6B-diffusion-bd3lm-ONNX (block diffusion, fused fp16, for the browser)
ONNX export of dllm-hub/Qwen3-0.6B-diffusion-bd3lm-v0.1
β BD3LM, a block-diffusion language model β packaged to run client-side in a web browser
on WebGPU via onnxruntime-web, driven by the
kohra denoising loop (kohra.js).
Block diffusion sits between autoregressive and fully-masked (MDLM) generation: the sequence is split into blocks of 32 tokens with a block-causal attention pattern β a block attends bidirectionally within itself and causally to all earlier blocks β and is denoised block-by-block, left to right. Same Tiny-A2D Qwen3-0.6B architecture as the MDLM sibling, but a separately-trained checkpoint with stronger reasoning: GSM8K 46.3 vs 29.3, HumanEval 46.3 vs 30.5.
Use it
Same kohra.js loader as the MDLM repo β block diffusion is one extra generate flag,
blockCausal: true (the graph takes a 2nd input, a block-causal attention mask, built for you):
import { pipeline } from './kohra.js';
const generate = await pipeline('text-diffusion', {
model: 'https://huggingface.co/naklitechie/Qwen3-0.6B-diffusion-bd3lm-ONNX/resolve/main/onnx/model_fp16_fused.onnx',
tokenizer: 'naklitechie/Qwen3-0.6B-diffusion-bd3lm-ONNX',
});
const { text } = await generate('Lily runs 12 km/h for 4 hours. How far in 8 hours?', { blockCausal: true });
console.log(text); // -> "...48 * 2 = 96 km. Thus, Lily runs \boxed{96} km in 8 hours."
Requires a WebGPU browser (Chrome/Edge 121+) over https or localhost. ~1.5 GB download (fp16, cached after first load); ~2.8 tok/s on an M-series Mac at 128 denoise steps.
Files
onnx/model_fp16_fused.onnx(+.onnx.data) β 2-input graph:input_idsand a[1,1,T,T]additive block-causalattention_mask(0 = attend, -1e9 = block, on thepos // 32grid). RMSNorm is fused toSimplifiedLayerNormalization(the WebGPU fp16 fix); attention stays decomposed so the 4D mask is honored.onnx/model_q4f16_rtn_sym.onnx(+.onnx.data) β 4-bit (RTN, symmetric) q4f16, ~680 MB. Coherent on WebGPU; fp16 stays the default at 0.6B (q4's dequant overhead and a small quality dip aren't worth it until the model is too big for fp16).- Tokenizer files (Qwen3 ChatML).
Notes
- No KV cache β one full forward per denoise step over the whole canvas. Block-causality is what makes the cache-free forward correct: a still-masked future block can't influence an earlier one, so the current block's logits are right regardless of what's downstream.
- The loop relies on the model's default
arangepositions (the graph has noposition_idsinput), so the prompt sits at[0,P)with no padding and the first generated tokens complete the prompt's last partial block β exactly the configuration the ONNX-vs-torch parity verified.
Attribution & license
Derivative of dllm-hub/Qwen3-0.6B-diffusion-bd3lm-v0.1 (built on Qwen/Qwen3-0.6B, Apache-2.0;
block-diffusion adaptation by dLLM). See the source repos.
Model tree for naklitechie/Qwen3-0.6B-diffusion-bd3lm-ONNX
Base model
Qwen/Qwen3-0.6B-Base