Qwen3-0.9B-A0.8B-small

This is a small version of Qwen/Qwen3-30B-A3B created for testing and development. It keeps every hyperparameter of the base model identical (hidden sizes, head counts, MoE topology, vocabulary, untied embeddings) and only reduces the number of decoder layers and the number of experts per MoE layer.

Model Details

  • Base Model: Qwen/Qwen3-30B-A3B
  • Architecture: Qwen3MoeForCausalLM (qwen3_moe)
  • Total Parameters: 0.89B
  • Activated Parameters: 0.85B (topk 8 of 10 routed experts per layer)

Configuration Changes

Only the allowed change classes were applied; everything else is identical to the base:

Parameter Base Small
num_hidden_layers 48 4
num_local_experts 128 10

All layers are MoE (decoder_sparse_step 1, mlp_only_layers []) with full attention, as in the base. 10 experts = topk (8) + 2 so that routing is actually exercised (8 = topk would make every expert always active). num_experts_per_tok (topk 8) is unchanged. All other values are kept from the base, including hidden_size 2048, moe_intermediate_size 768, 32 attention heads / 4 KV heads (head_dim 128, q/k norms), vocab_size 151936, untied embeddings, rope_theta 1e6.

Checkpoint Structure

Single-file bf16 model.safetensors (159 tensors) using the original base checkpoint layout: per-expert tensors model.layers.N.mlp.experts.{i}.{gate,up,down}_proj.weight (as in the base's sharded checkpoint), plus standard attention/norm/embedding/lm_head names. Tensor-name patterns match the base model.safetensors.index.json exactly, modulo layer and expert counts (validated programmatically: 15/15 normalized patterns, 0 missing, 0 extra; every small layer has the exact base per-layer key pattern set). The checkpoint loads through AutoModelForCausalLM.from_pretrained with the same weight-conversion path as the base repo, and all conversions round-trip bit-exactly.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("inference-optimization/Qwen3-0.9B-A0.8B-small", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("inference-optimization/Qwen3-0.9B-A0.8B-small")

input_ids = tokenizer("According to all known laws", return_tensors="pt").input_ids.to(model.device)
output = model.generate(input_ids, max_new_tokens=20)
print(tokenizer.decode(output[0]))

Creation Process

This model was created using the llm-compressor create-tiny-model skill:

  1. Loaded the base AutoConfig and applied only the allowed changes (4 layers, 10 experts).
  2. Built the model with skip_weights_download, re-initialized weights (init_weights() + NaN fixup), cast to bf16, and saved.
  3. Converted the saved checkpoint from transformers stacked-expert layout (mlp.experts.gate_up_proj / down_proj) to the base per-expert layout (reversing the qwen2_moe weight-conversion mapping).
  4. Fine-tuned on the skill's copypasta dataset in bf16 until target perplexity was reached (lr 5e-5, ~350 steps, early-stopped).
  5. Re-converted the fine-tuned checkpoint to the base layout and validated structure + round-trip against the base index.

Validation

  • Perplexity on the skill's validation text: 1.001 (target <= 10)
  • Greedy generation from "According to all known laws": produces the trained copypasta continuation correctly.

Notes

  • The base model has untied embeddings (tie_word_embeddings: false, separate lm_head.weight in the checkpoint), so the embedding matrices alone account for 2 x 0.31B parameters. This makes the total 0.89B rather than the ~0.6B a tied-embedding variant would give.
  • The tokenizer's pad_token was set to <|im_end|> (matching eos_token) for training convenience.
  • No quantization_config in the base; nothing stripped. bf16 throughout.
Downloads last month
48
Safetensors
Model size
0.9B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for inference-optimization/Qwen3-0.9B-A0.8B-small

Finetuned
(79)
this model

Collection including inference-optimization/Qwen3-0.9B-A0.8B-small