--- license: apache-2.0 language: - en library_name: transformers pipeline_tag: text-generation tags: - qwen3 - gguf - lm-studio - tiny-lm - chatml - muon - from-scratch --- # Voidling-67M-Instruct **Voidling-67M-Instruct** is a **67.4M-parameter** (42.2M non-embedding trunk) causal language model trained from scratch on a single TPU v5e-1 using the native **Qwen3** architecture (`Qwen3ForCausalLM`), making it natively compatible with `transformers`, `llama.cpp`, and **LM Studio** out of the box. It is the compact sibling of **Void-250M-Instruct**, designed to explore how far sub-70M models can be pushed under a tight compute budget using multi-stage WSD pretraining, Moonlight-Muon optimization, Skew-JSD knowledge distillation, and on-policy GKD. ## Architecture | Parameter | Value | |---|---| | **Architecture** | `Qwen3ForCausalLM` (Pre-RMSNorm + QK-Norm, SwiGLU, RoPE) | | **Total Parameters** | `67.39M` (`42.22M` trunk / `25.17M` tied embeddings) | | **Layers** | `14` | | **Hidden Size (`d_model`)** | `512` | | **FFN Intermediate Size** | `1536` (`3.0x` SwiGLU) | | **Attention Heads** | `8` Query / `2` KV (GQA `4:1`, `head_dim = 64`) | | **Vocabulary** | `49,152` (GPT-2 BPE, ChatML special tokens, tied embeddings) | | **RoPE Theta** | `50,000.0` | | **Context Length** | `1024` (trained), `2048` (`max_position_embeddings`) | | **Chat Template** | ChatML (`<|im_start|>role\ncontent<|im_end|>`) | ## Training Pipeline Trained entirely from scratch in JAX BF16 (`f32` master weights) with **Moonlight-Muon** (`wd=0.10` pretrain, `wd=0.05` decay/SFT, `z_loss=1e-4`): 1. **Stage 1 — WSD Pretraining Plateau (`13.36B` raw tokens, `ctx=512`):** - `75%` Bag-4 token-averaging / `25%` pure AR mix on `60%` Web (`FineWeb-Edu` + `Cosmopedia-v2`) / `20%` Python / `20%` Math (`FineMath-4plus` + `OpenWebMath`). - Peak Muon LR `3.5e-3`, `1,000`-step warmup. 2. **Stage 2A — Pure AR Recovery & Context Extension (`1.80B` AR tokens, `ctx=1024`):** - `100%` pure causal AR on fresh `60/20/20` shards at `1.5e-3` plateau LR. 3. **Stage 2B — WSD Cosine Decay + Skew-JSD Distillation (`450M` tokens, `ctx=1024`):** - Cosine decay `1.5e-3 → 5.0e-5` with `0.50` Hard CE + `0.50` Skew-JSD (`β=0.2, τ=1.5`) from `SmolLM2-360M` on `55%` Web / `20%` Code / `25%` Math. 4. **Stage 3 — Replay-Heavy ChatML SFT + Skew-JSD (`83.9M` tokens, `ctx=1024`):** - `70%` assistant-masked ChatML (`HuggingFaceTB/smol-smoltalk`) / `30%` multi-domain replay (`45%` Web / `35%` Code / `20%` Math) with `0.50` Hard CE + `0.50` Skew-JSD (`β=0.2, τ=1.5`) from `SmolLM2-1.7B-Instruct`. 5. **Stage 4 — On-Policy GKD Polish (`200` steps, `ctx=512`):** - `75%` on-policy student rollouts (`temp=0.75`) trained with mode-seeking Skew-JSD (`β=0.1, τ=1.5`) against `SmolLM2-1.7B-Instruct` + `25%` off-policy anchor to reduce repetition loops without forgetting. ## Held-Out Validation Progression (Cross-Entropy Loss, lower is better) | Stage | FineWeb | Code+Math | ChatML SFT | |---|---:|---:|---:| | Stage 1 End (`13.36B` raw) | `4.2265` | `2.4529` | — | | Stage 2A End (`+1.80B` AR `ctx=1024`) | `3.9341` | `2.2240` | — | | Stage 2B Final (`+450M` 360M KD Decay) | `3.7811` | `2.0968` | `2.0468` *(0-shot)* | | Stage 3 (`+83.9M` ChatML SFT + Replay) | `3.8116` | `2.1146` | `1.6746` | | **Stage 4 (On-Policy GKD Final)** | **`3.7798`** | **`2.1089`** | **`1.675`** | ## Available Files - `Voidling-67M-Instruct-F16.gguf` — Full 16-bit GGUF (`~135 MB`) - `Voidling-67M-Instruct-Q8_0.gguf` — 8-bit quantized GGUF (`~72 MB`, recommended for LM Studio / `llama.cpp`) - `hf/` — Native Hugging Face `Qwen3ForCausalLM` safetensors + tokenizer ## Usage ### LM Studio / `llama.cpp` Load `Voidling-67M-Instruct-Q8_0.gguf` or `Voidling-67M-Instruct-F16.gguf` directly. ChatML formatting is embedded in the GGUF metadata. Recommended sampling: `temperature=0.6`, `top_p=0.9`, `repeat_penalty=1.1`. ### Transformers ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "Grand011/Voidling-67M-Instruct" tok = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto") messages = [{"role": "user", "content": "Give me 3 practical tips for staying focused while studying."}] inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device) out = model.generate(inputs, max_new_tokens=160, do_sample=True, temperature=0.6, top_p=0.9, repetition_penalty=1.1) print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True)) ``` ## Limitations At **67.4M total parameters** (42.2M non-embedding), Voidling-67M-Instruct is an experimental tiny model intended for research, ultra-lightweight local testing, and edge experiments. It produces coherent short-form English advice and chat structure, but struggles with multi-step arithmetic, strict algorithmic coding, and deep factual recall.