Views
No views yet
[MASK] tokens over a few iterative denoising passes — so it can decode in parallel. This checkpoint is instruction-tuned: the diffusion base was chat-SFT'd on SmolTalk with a LLaDA-style objective (mask only the assistant response, denoise it conditioned on the clean prompt).hobby-rs) to run it on a laptop CPU.USER: / ASSISTANT: turn format. It adopts the chat register and the question→answer shape, but at 500M with a pure-diffusion objective it hallucinates and follows instructions loosely. Decode knobs trade quality vs speed; good defaults: temp 0–0.3, steps ≈ 2× the generation length, repetition penalty 1.4–1.5.| Component | Value |
|---|---|
| Total parameters | ~500M (only a fraction is active per token) |
| Hidden size / layers | 768 / 16 (first FFN dense, the rest MoE) |
| Routed experts / active | 36 / top-6 (+ 1 always-on shared expert) |
| Attention | GQA, 12 query / 3 KV heads, decoupled head-dim 128, per-head QK-norm |
| Router | sigmoid gating, DeepSeek-V3 aux-loss-free load balancing, no top-k renorm |
| Positional | RoPE (θ up to 1e6 for the 8k-context checkpoints) |
| Tokenizer | GPT-2 byte-level BPE (50,304 vocab, sentinel-padded) |
| Optimizer | Muon on the 2-D + per-expert matrices, AdamW on everything else |
[MASK] tokens, not left-to-right AR. The GGUF carries diffusion.* metadata (mask-token id, block size) for a diffusion-aware runtime; hobby-rs implements the cached semi-autoregressive denoiser.| Metric | Value |
|---|---|
| Validation loss (≈21B tokens) | 3.52 |
| Throughput — H100, 128 tok, 32 steps | 117.7 tok/s (~2.7× the AR model) |
| Throughput — H100, AR baseline | ~44 tok/s |
| Throughput — laptop CPU (q8, cached) | ~6.5 tok/s |
A masked-diffusion LM at 500M trails an equal-scale autoregressive model on raw coherence — the method is fully validated end-to-end here; the limit is capacity and tokens, not the recipe.
transformers AutoModel for it, so load it with
the small reference implementation from the GitHub repo:1# HobbyLM-Diffusion is a MASKED-DIFFUSION model: generation is iterative, bidirectional denoising
2# — NOT autoregressive — so it uses the reference diffusion sampler (not transformers.generate).
3# pip install torch safetensors tiktoken huggingface_hub
4# git clone https://github.com/harishsg993010/HobbyLM && cd HobbyLM
5
6import json, torch, tiktoken
7from huggingface_hub import hf_hub_download
8from safetensors.torch import load_file
9from hobbylm.config import ModelConfig
10from hobbylm.model import MoETransformer
11from hobbylm.diffusion import generate
12
13repo = "rootxhacker/HobbyLM-Diffusion"
14cfg = ModelConfig(**{k: v for k, v in json.load(open(hf_hub_download(repo, "config.json"))).items() if k != "preset"})
15cfg.expert_backend = "bmm" # "grouped" on CUDA
16model = MoETransformer(cfg).eval()
17model.load_state_dict(load_file(hf_hub_download(repo, "model.safetensors")))
18
19enc = tiktoken.get_encoding("gpt2")
20ids = torch.tensor([enc.encode_ordinary("The meaning of life is")])
21# iterative denoising: gen_len tokens over `steps` bidirectional passes (more steps + lower temp = better)
22out = generate(model, ids, gen_len=96, steps=128, temperature=0.2, rep_penalty=1.5, remask_steps=2)
23print(enc.decode(out[0].tolist()))hobbylm) live in rootxhacker/HobbyLM-gguf. They load
directly in the from-scratch hobby-rs CPU engine — stock llama.cpp won't load them without registering
the hobbylm architecture first.hobby-rs --model HobbyLM-Diffusion.gguf --prompt "..." --n 64