SlothLM-E 11.6M â Zhuyin (Bopomofo) â Traditional Chinese
The smallest useful Slothing model: a 3.9M-parameter bidirectional encoder found by neural architecture search (18-config Hyperband) over the sub-5M space, trained on g2pW context-aware readings (neural Taiwan polyphone disambiguation, not rule-based g2p).
Non-autoregressive: N bopomofo syllables in â N Traditional-Chinese characters
out, one forward pass, constrained to each syllable's phonetically legal
characters (phonetic_table.tsv, Taiwan-standard readings).
Architecture
dim 256 ¡ depth 12 ¡ 8 heads (KV 2) ¡ FFN 768 ¡ RoPE ¡ GQA ¡ QK-norm ¡ RMSNorm
¡ SwiGLU ¡ post-embedding RMSNorm (Ă la ModernBERT â it won the NAS final)
¡ char-hint conditioning channel (weight-tied to the output head, ~0
params): a third input (hints, id 0 = none, else char_id+1) trained with
0â30% of true chars revealed â feed a user's correction back and the whole
sentence re-scores around it (ć°ćł¨éł-style interactive re-scoring). The same
channel carries document context: committed text before the cursor rides
-id prefix positions (e.g. context ć匚匚說 flips äťĺžćźäşŽâ弚ĺžćźäşŽ).
Trained with typo-noise (8% ED1-valid syllable corruption) for robust
typo-repair scoring. Zero hints = normal decode.
Accuracy (sentence-exact)
| eval | this 11.6M | 32M ref | libchewing |
|---|---|---|---|
| homophone-hard (159) | 82% | 83% | 71% |
| ĺ é¸ĺ everyday (230, held-out) | 72% | â | â |
| toneless (159) | 79% | 81% | â |
*chewing floor measured on the earlier 30-case set; 230-case floor pending.
Sub-5M finding: homophone accuracy saturates near 3M params; whole-sentence
â ď¸ Eval-leakage correction (2026-07-12): the original ĺ é¸ĺ numbers (incl. "84%"/"86%") were measured on a set SAMPLED FROM THE TRAINING CORPUS (174/174 sampled lines verbatim in training) â memorization-inflated by ~12-18pts. On a held-out set (fresh c4, excluded against training) the shipped 11.6M scores 72% ĺ é¸ĺ (homophone-hard 82% / toneless 79% were already clean). This 11.6M is the shipped model (int8, 13MB).
Repo renamed from
slothlm-e-4m-zhuyin(legacy 3.8M) to reflect the 11.6M shipped model; the old slug redirects.
Reproducibility
Everything needed to reproduce this model from public sources is in this repo:
REPRODUCE.md (step-by-step commands), reproduce/ (corpus
builder, g2pW labeling pipeline, tokenizer/table builders, NAS driver, trainer,
gate, ONNX export), eval/ (both test sets + the ĺ
é¸ĺ set builder), and
tokenizer/. Training data: 1.1M short TC sentences streamed from
erhwenkuo/c4-chinese-zhtw,
relabeled with g2pW (Interspeech 2022)
context-aware Taiwan readings. NAS: 18-config Hyperband, seed 1234, rungs
1.5/4/8 epochs. Living code: GitHub.
Files
slothe.ptâ PyTorch checkpoint (training/fine-tuning)onnx/model.onnx(+.data) â fp32 exportonnx/model_quantized.onnxâ 5.0MB per-channel int8, lossless vs fp32 (naive per-tensor int8 loses 12pts on toneless â don't use it)syl_vocab.json,phonetic_table.tsvâ serving-side vocab + legality tabletokenizer/â the char tokenizer (defines output ids)REPRODUCE.md,reproduce/,eval/â full reproduction pipeline + evals
Demo
Runs in-browser via onnxruntime-web: https://huggingface.co/spaces/Luigi/slothing-web
- Downloads last month
- 47