Skip to main content
conformance ✓ spec 1.0 qwen3 The Model Spec of Qwen/Qwen3-0.6B in TheFormalEra.Spec.Registry. The constants below are transcribed from its published config.json, and the official transformers.Qwen3ForCausalLM is checked against them.

At a glance

What to watch for

  • Every layer is full causal attention: 16 query heads share 8 KV heads (2 query heads per KV head), head dim 128, scale 1/√128.
  • Queries and keys get a per-head RMSNorm (attn.qk_norm) before RoPE.
  • RMSNorm weights are applied as w (rmsnorm).
  • The language-model head is tied to the embedding.

Compute-graph nodes

Use these paths in Spec Keys: Qwen/Qwen3-0.6B@1.0:layers[*].<node> for per-layer nodes, Qwen/Qwen3-0.6B@1.0:<node> for the others. Nodes listed twice have different constants in different layers (for example, sliding-window and global attention). A kernel annotated with layers[*].<node> is verified against each variant.

Tensors of the main nodes

Conformance

The official transformers.Qwen3ForCausalLM agrees with this spec, layer by layer in float64, to a maximum relative error of 1.5e-15 (reduced-width profile, 2 weight draws × 2 lengths). On the published checkpoint, the full-size spec evaluated by the Lean oracle agrees with the official implementation to 7.7e-15 on a real prompt (85.5 s).

Published configuration