A custom mixture-of-experts decoder pretrained from scratch (random init) on
HuggingFaceFW/fineweb-edu
(sample-10BT, streaming), ~65M tokens in one ~82-minute run on a single NVIDIA A10G.
This model requires trust_remote_code=True — the architecture source ships in
modeling_zhouaz_moe.py.
| Metric | Value |
|---|---|
| final eval loss | 4.7106 |
| eval perplexity | ≈ 111 (exp of eval loss) |
| final train loss (real) | 4.66 |
Heavily undertrained (65M tokens for ~194M active params — Chinchilla would want ~4B+). It demonstrates the architecture and pipeline, not quality: expect repetitive, low-coherence text.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("zhouaz/moe-500m-fineweb-edu")
model = AutoModelForCausalLM.from_pretrained(
"zhouaz/moe-500m-fineweb-edu", trust_remote_code=True).eval()
ids = tok("The history of the Roman Empire begins", return_tensors="pt").input_ids
for _ in range(60):
with torch.no_grad():
logits = model(ids).logits
ids = torch.cat([ids, torch.multinomial(torch.softmax(logits[0, -1] / 0.8, -1), 1)[None]], 1)
print(tok.decode(ids[0], skip_special_tokens=True))
The Trainer's loss field in logs is the pre-gradient-accumulation value (accum=4);
divide by 4. Eval loss is unaffected.
model.safetensors 2.0 GBtraining_args.bin 5.9 kB