Zhiyi zhen-mini-1201
A Chinese / English input-method model of Zhiyi IME for phones, in about 12 MB: 4 ModernBERT layers of width 256 run twice with the same weights (a looped encoder), reading 32 tokens of context, a 32,000-token vocabulary, weights in 4 bits, and one shared hashed n-gram memory table (250,007 rows x 64, stored as product quantization, 4 MB). It does three things:
- word choice: one score per candidate (Simplified Chinese, English; Traditional Chinese with pinyin, Zhuyin, Jyutping, Cangjie and Quick);
- sentence composition (new): from typed syllables (full pinyin or initials, Traditional pinyin, Zhuyin with
tones, Jyutping) the decoder writes the whole sentence,
qu gong yuan san bu→去公园散步,w m ming tian jian→我们明天见,nei hou maa→你好嗎; - next words: the same 2-layer decoder proposes the next words after a word is committed (Simplified Chinese words
in Chinese mode, English words in English mode), single characters too when asked (
是,我,的: what phone keyboards offer), completes a Chinese word whose first characters are already typed, and fills a gap mid-text: with the cursor inside the text it also reads the text after the cursor (你的作业|了吗, "your homework | yet?").
It replaces zhen-mini-loop-1130 in this repository. New: composition by the next-word decoder. There is no separate composition head: the next-word decoder has a second start vector, and when it starts with that one it reads the encoded syllables and writes the sentence token by token over the same 32k tokens, each step also given the encoder's state of the syllable it is at (one new 256 × 256 projection). Only the characters each syllable allows can be written, so the output always matches the typed input. The new weights add 66 thousand parameters; word choice runs the same graph as before (361 million multiply-adds a row).
It is not 1130 with something added: it was trained again from the same language-model pre-trained weights, in one stage on everything at once, with the composition rows (and 1130's single-character next-word rows) mixed in from the start. The price is paid in word choice and next words, a little: against 1130 (PyTorch, the table as PQ16) neutral v2-v5 92.98 / 93.31 / 92.30 / 70.98% instead of 93.67 / 93.63 / 92.45 / 71.51% (4-bit ONNX, the charts' scorer: 92.6 / 93.1 / 92.2 / 71.5% instead of 93.5 / 93.3 / 92.2 / 71.8%); Chinese next word 11.2 / 21.6% instead of 11.4 / 22.3%, English 19.9 / 37.1% instead of 20.5 / 39.0%. A model that has to learn three tasks in 4 layers gives up some of each.
Composition (PyTorch fp32, beam 8, 3,000 rows a set, whole sentence right / characters right): long Simplified pinyin
50.9 / 83.9%, Traditional pinyin 40.3 / 71.3%, Zhuyin 68.5 / 91.4%, Jyutping 35.9 / 68.1%: about the
level of zhen-feather-1127 (8 layers, a 44 MB file), which has its own composition head. At 4 bits the
composition loses about 5 points of whole sentences (word choice and next words lose much less): see "Accuracy" and
the onnx/w4-dec8 folder, whose decoder keeps an 8-bit token table and gets back a third to a half of that.
A preview: Zhiyi IME does not use it yet. zhen-mini-loop-1130, zhen-mini-next-1129, zhen-mini-next-1126, zhen-mini-next-1123 and zhen-mini-next-preview-1116 stay in this repository's history; 1116 also in its GitHub release. All Zhiyi models: https://github.com/dd1000001000/zhiyi_models
| File | |
|---|---|
model.safetensors | all weights (12.9 MB): 41 matrices already 4-bit as ggml Q4_0 blocks, the n-gram table as PQ16 codes + codebooks, the rest F32 (with the loop's loop_norm.0.weight and the composition mode's next.start_comp, next.slot_in) |
config.json | the structure (with encoder.layer_types), prefix_mask, shared_head, compact, choice_only, next_word_decoder, special tokens, sequence settings (choice_context_tokens 32), ml, next_word (the decoder, rows_are_tokens, context_tokens 32, compose: how composition runs), ngram (the table: its keys and hash), encoder.loop (the passes), vocab_size and q4_0: each 4-bit tensor's [rows, columns] |
next_rows.json | per token: its piece and text, the mode masks (zh, en_start, en_cont), the end token, characters per token |
tokenizer.json | the 32k Unigram tokenizer: context, tags, typed text, the composition sequence |
tokenizer.candidates.json | the same with Metaspace prepend_scheme never: candidates, Chinese and English (no leading ▁); also each token's text in composition |
unified_vocab.json | the units and letters of the typed slots, and the character tables composition needs: chars, readings (Simplified pinyin), ml.pinyin / ml.jyutping (Traditional), ml.simp_only |
test_vectors.safetensors | 13 word-choice, 12 next-word (4 of them mid-text) and 5 composition inputs with the fp32 PyTorch model's outputs, to check an implementation |
candle_ref/ | a reference forward pass in Rust (candle 0.11), version 0.10.1: reads the 4-bit file, the table and the loop; word choice and next words (composition: not implemented, use the ONNX file) |
onnx/w4/ | laya.mini.w4.onnx (15.3 MB, word choice, composition and next words in one file, the table included: opset 21 + com.microsoft MatMulNBits / GatherBlockQuantized), with both tokenizers and the JSON files |
onnx/slim/ | the same file in 13.7 MB (laya.mini.w4.onnx: the head's in-projection 4-bit too, scales float16); same inputs and outputs |
onnx/w4-dec8/ | laya.mini.w4d8.onnx (24.6 MB): onnx/w4's file with the decoder's own 8-bit token table (input and read-out) instead of sharing the encoder's 4-bit one: composition about 2 points better (see "Accuracy"); same inputs and outputs |
example.py | the quick start below |
LICENSE | Apache License 2.0 |
Quick start (Python, ONNX Runtime)
Word choice, next words, mid-text and composition with onnx/w4/laya.mini.w4.onnx (the code is in example.py):
pip install onnxruntime tokenizers numpy huggingface_hub
python example.py
D = os.path.join(snapshot_download("zhiyi-ime/zhiyi-zhen-mini-12M", allow_patterns=["onnx/w4/*"]), "onnx", "w4")
tok = Tokenizer.from_file(os.path.join(D, "tokenizer.json")) # context, tags, typed text
ctok = Tokenizer.from_file(os.path.join(D, "tokenizer.candidates.json")) # candidates (no leading ▁)
BOS, EOS, MASK = 2, 1, 4
CTX = 32 # context tokens
# 1. Word choice: <bos> context <eos> <mask> x syllables <eos> cand1 cand2 ... <eos>; one score per candidate
# (context mode on the leading block, then key mode on the rest with that cache; ctx_tail = the context's last
# two tokens, for the table's candidate keys)
print(choose("今天天气很好,我们去公园", ["san", "bu"], ["散步", "散布", "三部"]))
# 2. Next words: context mode once (cross_k_out / cross_v_out / cross_mask_out: the context and the table's four
# positions), then is_step in a beam search over the 32k tokens
print(next_words("今天天气很好,我们一起去"))
print(next_words("Thank you very much for your", lang="en"))
print(next_words("我们明天去公", min_chars=1)) # completion: the typed start of the word ends the context
print(next_words("你的作业", right="了吗")) # mid-text: <bos> left <mask> right <eos>
# 3. Composition: the composition encoder (is_compose) once, then is_step + dec_comp in a beam search where only
# the characters the typed syllables allow can be written
composer = Composer(D, session=mini, tok=tok)
print(composer.compose("今天天气很好,我们", [("f", "qu"), ("f", "gong"), ("f", "yuan"), ("f", "san"), ("f", "bu")]))
print(composer.compose("", [("p", "w"), ("p", "m"), ("f", "ming"), ("f", "tian"), ("f", "jian")])) # initials only for 我们
print(composer.compose("今天天氣很好,我們", [("f", "qu"), ("f", "gong"), ("f", "yuan")], lang="zh-Hant")) # Traditional
print(composer.compose("", [("jf", "nei"), ("jf", "hou"), ("jf", "maa")], lang="zh-Hant")) # Jyutping
Output (ONNX Runtime 1.30.0, CPU):
[('散步', 2.64...), ('散布', -5.57...), ('三部', -7.26...)]
[('看看', -2.14...), ('旅行', -3.38...), ('旅游', -3.75...), ('逛逛', -4.14...), ('游玩', -4.55...)]
[('support', -2.31...), ('feedback', -3.56...), ('help', -3.57...), ('gift', -3.62...), ('email', -3.85...)]
[('司', -1.19...), ('交', -2.14...), ('安', -2.53...), ('园', -4.02...), ('交所', -4.14...)]
[('怎么', -3.68...), ('完成', -3.79...), ('完蛋', -4.82...), ('完好', -5.52...), ('好坏', -5.66...)]
[('去公园散步', -0.26...), ('去公园散布', -2.61...), ('区公园散步', -2.61...), ('取公园散步', -4.40...), ('区公园散布', -4.81...)]
[('我们明天见', -0.72...), ('我明明天见', -3.15...), ('我满明天见', -3.37...), ('我么明天见', -4.64...), ('我忙明天见', -4.64...)]
[('去公園', -0.40...), ('璩公園', -3.78...), ('區公園', -3.80...), ('蕖公園', -4.03...), ('蛐公園', -4.52...)]
[('你好嗎', -0.73...), ('你好媽', -1.06...), ('您好嗎', -3.26...), ('您好媽', -3.47...), ('你好馬', -3.69...)]
The first word-choice and next-word calls build the inputs of test_vectors.safetensors cases 0, next0, next5,
next7 and next8 (token for token), the first and the last composition calls those of comp0 and comp4;
the 4-bit file's words differ a little from the vectors' fp32 ones. With the default min_chars=2 a next-word list
holds words of two or more characters only; min_chars=1 lets single characters in, ranked together with the words.
Traditional word-choice rows add the tag <zh-Hant> after <bos> and the typed text instead of <mask> units (see
"Inputs"). For the other files, change onnx/w4 to onnx/slim or onnx/w4-dec8 in example.py (it picks the file
in the folder). Set MINI_DIR to a local folder to skip the download.
Using the single file
The bool inputs is_step and is_compose pick the branch (If nodes run only that one). Every input has a small
default, so ONNX Runtime lists them as overridable initializers, not as graph inputs
(get_overridable_initializers()); feed them by name and leave out what the branch does not use. A caller written for
zhen-mini-loop-1130 runs unchanged (the new inputs default to false / zeros).
is_stepfalse (the default),is_composefalse (the default), word choice:input_ids,unit_ids,past_enc_k/past_enc_v(8 × 1 × 4 × P × 64: one entry per layer run, the 4 layers of pass 1 then the 4 of pass 2),past_choice_k/past_choice_v(1 × 1 × 4 × P × 64) withpast_mask,marker_pos,ctx_tail(1 × 2: the context block's tokens at positions n−3 and n−2, before its<eos>; −1 when the block has under 3 tokens, i.e. an empty context) →logits,present_0…present_3(the encoder's and the head's keys and values),cross_k_out/cross_v_out,cross_mask_out. Context mode (the leading block<bos> … <eos>, no past) gives the cache; key mode (the rest, the cache as the past) gives the scores, withmarker_poscounted from the start of the rest. Pass the samectx_tailin both modes (context mode does not read it): a candidate's first tokens are keyed on the context's last tokens in the n-gram table.- Next word, once per context: context mode on
<bos> context[last 32 tokens] <eos>(mid-text:<bos> left <mask> right <eos>, below) with unit ids 0 →cross_k_out,cross_v_out(2 × 1 × 4 × (T + 4) × 64), the decoder's cross-attention keys and values of the T context positions and the table's four positions, andcross_mask_out(1 × (T + 4), all true for one context). In an input method this is the context pass word choice already runs, when the contexts are the same. is_composetrue (withis_stepfalse), the composition encoder, once per input:input_ids/unit_ids= the whole composition sequence (below; no cache) →cross_k_out,cross_v_out(2 × 1 × 4 × (L + 4) × 64: every position of the sequence and the table's four),cross_mask_out(1 × (L + 4)) andslot_states(1 × L × 256: the slot input of each position).is_steptrue, one decoder step for N hypotheses:prev(N, the previous token; any value at position 0),pos(N),dec_past_k/dec_past_v(2 × N × 4 × P × 64) withdec_past_mask(N × P; at position 0 a placeholder of length 1, false),cross_k/cross_v(2 × N × 4 × (T + 4) × 64, one copy per hypothesis) withcross_mask(N × (T + 4)) →logits(N × 32,000, one per token),present_0/present_1= the decoder's keys and values with this step appended. Composition setsdec_comptrue and givesslot_x(N × 256): for each hypothesis theslot_statesrow of the<mask>of the next syllable it has to write (the syllables written so far = the characters of its tokens), the final<eos>'s row once every syllable is written; the logits of tokens that are not Han characters (Simplified or Traditional) or<eos>come out as −10⁴. Next words leavedec_compfalse andslot_xat its default (zeros).
Speed (ONNX Runtime 1.30.0, CPU, AMD Ryzen 5 9600X; 1201 and 1130 timed in turn in one process; the search loop around the graph not counted; 300 pages of neutral v2, 300 + 300 next-word test contexts and 300 composition rows of the Simplified pinyin dev set (median 6 syllables), medians):
| 1201, 4 threads | 1201, 1 thread | 1130, 4 threads | 1130, 1 thread | |
|---|---|---|---|---|
| Word choice, context mode (once per context) | 3.02 ms | 4.25 ms | 3.15 ms | 5.37 ms |
| Word choice, a key | 2.99 ms | 4.06 ms | 3.17 ms | 5.11 ms |
| A whole next-word prediction (slim file, beam 8, 5 words) | 5.80 ms | 9.69 ms | 5.81 ms | 8.97 ms |
A whole composition (onnx/w4, beam 8, 5 sentences) | 9.55 ms | 16.08 ms | — | — |
Word choice and next words run the same computation as 1130 (the differences are noise of the machine; the 1130 card's own timing, on a quieter run, was 2.24 / 2.26 / 3.75 ms with 4 threads).
Memory of a Python process running example.py (ONNX Runtime, both tokenizers, next_rows.json and the composition
tables; loaded / after a few calls): 171.4 / 204.9 MB, 1130's 147.8 / 162.8 MB (the
composition's character tables, built on demand, make most of the difference).
Training
One RTX 5070 Ti. 1201 repeats 1129's first steps (the same pre-trained weights), then trains its own joint stage.
- Layers and context: zh-lite-next-preview's 8-layer encoder (Lite x8, 128 tokens of context) cut to its layers 0, 2, 5 and 7 and trained on word choice at 32 tokens of context (the 8-layer model as the teacher) for one pass over 4 million rows; then its token table cut to the 32k vocabulary and zhen-mini-next-preview-1116's next-word decoder put on.
- One stage on everything at once (zhen-mini-next-1123's recipe, 369,712 steps): every step 144 word-choice rows (one pass over 52.6 million Simplified Chinese, Traditional and English rows) with the 8-layer model reading 128 tokens as an online teacher (KL 0.7 at temperature 2, mixed 1:1 with the stored scores of Qwen3.5-9B LoRA teachers where a row has them), and 96 next-word rows (four epochs of 5.6 million Simplified Chinese and 3.27 million English rows; Qwen3-1.7B-Base's top 30 words as targets, the mid-text rows' words rescored with the right side, 70% of those trained with it). The new table learns with the rest (its own learning rate, 1e-3, no weight decay).
- The table: one table of 250,007 rows x 64, keyed two ways (below). A run with two separate tables of 125,003 rows each (one for the encoder, one for the decoder) scored the same within noise; the shared one is simpler.
- 1126 was 1123 trained one pass further on 447,745 long-span, short-context word-choice rows (6-20 characters typed, at most 30 characters of context; candidates from seven input-method engines; Qwen3.5-9B LoRA scores alone). 1129 starts again from 1123 instead:
- Pre-training (new in 1129; 878,196 steps of 1,024 rows from 1123's weights): the next-word decoder learns to write up to 20 tokens that follow 32 tokens of context, over all 32k tokens; the encoder and the table learn with it. 46.8 billion tokens read once, at the data's own shares: Simplified Chinese 34.8 B, Traditional 6.1 B, English 6.1 B, from FineWeb-2 (cmn_Hani, yue_Hani), FineWeb, LCCC, CSL and SODA, with every document that shares lines with a test or dev set left out. AdamW (beta2 0.95), learning rate 1.5e-4, encoder 5e-5, table 3e-4; a QK-clip (each attention head's largest logit kept at most 50) after the decoder's self-attention logits once ran away.
- The loop (from 1130): the 4 encoder layers run twice with the same weights through the whole joint stage; the new LayerNorm in front of layer 0's second pass starts with weight 1 and learns with the encoder. In 1130 (the same training without composition) it gained v2-v5 +0.1 / +0.3 / 0.0 / +0.8 over 1129, and those weights scored 91.0 / 91.6 / 91.4 / 64.5% when run with one pass only: the second pass does real work.
- 1201's joint stage (453,032 steps, 17.8 hours, from the pre-trained weights, the loop on; learning rate 1e-4,
encoder 1.4e-4, table 1e-3, warm-up 3,000, the last 10% decayed), every step:
- 120 word-choice rows: one pass over 1129's word-choice data (the 52.6 million rows plus 1126's 447,745 short-context rows four times over; the online 8-layer teacher mixed 1:1 with the stored Qwen3.5-9B LoRA scores, the short-context rows on those scores alone), spread over the longer run (1130: 147 a step);
- 96 next-word rows: four epochs of 10.87 million rows, 1130's Chinese and English rows plus 2.0 million
natural-mix Chinese rows (zhen-feather-1127's: the text's real next unit, a single character or a word, as it
comes, so that one list ranks both; 1130 got these only in a decoder-only top-up afterwards). The word rows start
the decoder with a second start vector, the natural rows with the usual one; the exported files keep only the
usual one (one list for everything,
min_charspicks whether single characters may end it), and the numbers here are of that graph; - 96 composition rows (new): about 4.8 passes over 8.72 million rows (zhen-feather-1127's composition data:
Simplified and Traditional pinyin, Zhuyin and Jyutping, long and short contexts) plus rare-character rows. The
target is the text itself (no teacher): the decoder starts with
start_compand writes the text's tokens, then<eos>; every position addsslot_inof the encoder state at its syllable (slot_instarts at zero,start_compas a copy ofstart). The unit and tone vectors learn at 2e-4. - A QK-clip on the decoder's attention heads (each head's largest logit kept at most 200), as in the pre-training: a dense objective like this one had made the decoder diverge there.
- Then the table stored as PQ16 (16 sub-vectors of 4 values a row, 256 codes each: 64 MB of float32 to 4 MB; the neutral sets move by at most 0.3 points, next words by at most 1.2, composition by at most 0.4) and the weights rounded to 4 bits.
- What composition costs: after three of the four epochs this run scored v2-v5 93.30 / 93.37 / 92.44 / 70.86% against 1130's training at the same point 93.71 / 93.39 / 92.53 / 71.92% (v5 −1.05, paired p 0.017; the two runs also differ in the single-character rows). Adding the decoder's score of each whole candidate to the word-choice head's gained only 0.1, so the word-choice scores here are the head's alone.
The 4-bit format and the table
A tensor listed in config.json q4_0 is stored as ggml's Q4_0 blocks: dtype U8, shape rows × (columns / 32 × 18).
Each block of 32 values along a row is 18 bytes: an f16 scale d (little-endian), then 16 bytes q; value j
(0…15) is ((q[j] & 15) − 8) · d, value j + 16 is ((q[j] >> 4) − 8) · d. This is the layout candle's
qtensor_from_ggml(GgmlDType::Q4_0, …) (and llama.cpp) read, so a linear layer runs as a 4-bit matrix product:
use candle_core::quantized::{ggml_file::qtensor_from_ggml, GgmlDType, QMatMul};
let raw = safetensors.load(name, &device)?.flatten_all()?.to_vec1::<u8>()?;
let w = QMatMul::from_qtensor(qtensor_from_ggml(GgmlDType::Q4_0, &raw, vec![rows, cols], &device)?)?;
// w.forward(&x) = x · wᵀ, then add the bias if the layer has one
The 4-bit tensors: every linear weight of the encoder, the head and the decoder, scorer.1, ng_proj,
next.mem_proj, next.slot_in, and the two embedding tables encoder.embeddings.tok_embeddings.weight (32000 × 256) and
unit_emb.weight (3833 × 256), whose rows are unpacked when read. The token table is also the read-out: keep it as a
Q4_0 matrix for x · tableᵀ and unpack only the rows a lookup needs (one copy in memory). Everything else (norms,
biases, type_emb, tone_emb, cand_emb, next.start, next.start_comp, next.pos.weight, next.bias, next.mem_type,
scorer.3) is F32.
The table (ngram.codes U8 250007 × 16, ngram.codebooks F32 16 × 256 × 4): row r is the 16 codebook vectors
codebooks[p, codes[r, p]] (p = 0…15) one after another, 64 values.
The hash (config.json ngram.hash): for a salt and key tokens t₁ … tₖ, in int64 with a wrapping multiply,
x = salt * 0x9E3779B1 + 12345
for t in t1 ... tk: x = (x XOR (t + 1)) * 0x100000001B3; x = x XOR (x >> 29) (arithmetic shift)
row = x mod 250007 (non-negative)
An absent key token is −7.
Tensors
Names are the PyTorch ones.
| Tensor | Shape | |
|---|---|---|
encoder.embeddings.tok_embeddings.weight | 32000 × 256 | Q4_0; token id = row |
encoder.embeddings.norm.weight | 256 | LayerNorm, no bias |
encoder.layers.N.attn_norm.weight (N ≥ 1; layer 0 has none) | 256 | |
encoder.layers.N.attn.Wqkv.weight | 768 × 256 | N = 0…3, Q4_0 |
encoder.layers.N.attn.Wo.weight | 256 × 256 | Q4_0 |
encoder.layers.N.mlp_norm.weight | 256 | |
encoder.layers.N.mlp.Wi.weight | 1024 × 256 | Q4_0 |
encoder.layers.N.mlp.Wo.weight | 256 × 512 | Q4_0 |
loop_norm.0.weight | 256 | the loop: layer 0's attention norm at the second pass (LayerNorm, no bias) |
encoder.final_norm.weight | 256 | |
unit_emb.weight | 3833 × 256 | Q4_0; row 0 = none, 1-3804 the units of unified_vocab.json, 3805-3832 letters |
tone_emb.weight | 6 × 256 | Zhuyin tones: row 0 = none, 1-5 (5 = neutral) |
type_emb.weight | 3 × 256 | row 0 is the one used (word choice and the decoder's memory) |
cand_emb | 256 | added at each candidate's first token |
ngram.codes, ngram.codebooks | 250007 × 16, 16 × 256 × 4 | the n-gram table (PQ16) |
ngram.idmap | 32000 (I32) | token id → the id the encoder's keys are hashed on (the 256k vocabulary's) |
ng_proj.weight, ng_proj.bias | 256 × 128, 256 | the encoder's table rows (2 × 64) → its input |
head.layers.0.* | one nn.TransformerEncoderLayer (matrices Q4_0) | |
scorer.0 (LayerNorm), scorer.1 (256 → 256), scorer.3 (256 → 1) | word choice | |
next.mem_in.0 (256 → 256), next.mem_in.1 (LayerNorm) | the decoder's memory | |
next.mem_proj (64 → 256), next.mem_norm (LayerNorm), next.mem_type (4 × 256) | the decoder's four table positions | |
next.tok_in (256 → 256) | a token's embedding → the decoder's input | |
next.start | 256 | the input at position 0 |
next.start_comp | 256 | the input at position 0 in composition |
next.slot_in (256 → 256) | composition: the encoder state of a position's syllable → added to its input (weight Q4_0) | |
next.pos.weight | 22 × 256 | learned positions |
next.layers.N.* (N = 0, 1) | nn.TransformerDecoderLayer: self_attn, multihead_attn (in_proj_weight = q, k, v stacked, 768 × 256), linear1 (256 → 1024), linear2, norm1-norm3 | |
next.out.0 (LayerNorm), next.out.1 (256 → 256) | the decoder's output | |
next.bias | 32000 | the read-out's bias, per token |
Forward pass: encoder and word choice
One sequence at a time (batch 1, no padding; with padding, mask padded keys in every attention).
The prefix mask. Let n be the position of the first <eos> (1) plus one: positions 0 … n−1 are the
leading block. A query inside the block may attend only to keys inside it; a query after it attends to every key
(within the sliding window where the layer has one). This holds in every encoder layer and in the head layer.
x = tok_emb[input_ids] + unit_emb[unit_ids % 3833] + tone_emb[unit_ids / 3833], pluscand_embat every position inmarker_pos(each candidate's first token).- The table (n-gram rows), on the ids
o = ngram.idmap[input_ids]: for every context position p (1 ≤ p < n − 1, between<bos>and the first<eos>) and every candidate token (from the first marker up to, not including, the final<eos>):prev1 = o[p − 1],prev2 = o[p − 2](−7 at p < 2); for a candidate token at offsetofffrom its candidate's first token:off = 0→prev1 = o[n − 2],prev2 = o[n − 3](the context's last two tokens; −7 when n < 3: an empty context),off = 1→prev2 = o[n − 2];k2 = hash(1; prev1, o[p]),k3 = hash(2; prev2, prev1, o[p]);x[p] += ng_proj(concat(row(k2), row(k3))). Other positions (<bos>, the<eos>s, the typed units) get nothing. Then LayerNorm (encoder.embeddings.norm).
- Encoder: 4 pre-norm ModernBERT layers, width 256, 4 heads of 64, run twice (
config.jsonencoder.loop.passes2): layers 0, 1, 2, 3, then 0, 1, 2, 3 again on the result, with the same weights.h = attn_norm(x)(layer 0:h = xin the first pass,h = loop_norm.0(x)in the second);q, k, v = split(Wqkv h), laid out as (3, heads, 64).- RoPE on q and k, base 160000, rotate-half form:
x·cos + rotate_half(x)·sin, frequencies1 / 160000^(2i/64), positions 0, 1, 2, …. - Attention with scale 1/8 and the prefix mask.
config.jsonencoder.layer_typesgives each layer's kind: layers 0, 1 and 3 attend globally (full_attention), layer 2 only where |i − j| ≤ 64 (sliding_attention). x += Wo(attention); thena, g = split(Wi mlp_norm(x))(512 each),x += mlp.Wo(gelu(a) · g), with the exact (erf) GELU.- After the last layer of the second pass,
final_norm. No biases anywhere in the encoder.
- Head:
h0 = encoder output + type_emb[0], thenhead.layers.0(PyTorchnn.TransformerEncoderLayer,norm_first=True, 4 heads, feed-forward 1024 with ReLU, LayerNorm eps 1e-5,in_proj_weight= q, k, v stacked; no final norm), with the prefix mask. - Word choice: at each candidate's first token
p,score = scorer.3(gelu(scorer.1(scorer.0(h0[p])))). Higher is better.
Caching the context. Run the block alone once per context and keep the keys and values (after RoPE) of each of
the 8 layer runs for its n positions; on each key run only the positions after it (the ONNX file's context and key modes). The key
part needs the context's last two tokens for the candidates' table keys (ctx_tail).
Forward pass: the next-word decoder
- Memory. Encode
<bos> encode(context)[last 32 tokens] <eos>(English: the context's trailing spaces cut first) with the encoder above (unit ids 0, no candidates; one prefix block, so the plain mask with the sliding window).m = LayerNorm(next.mem_in.0(encoder output + type_emb[0])), (T, 256). Mid-text:<bos> L <mask> R <eos>withR = encode(right)[first 32 tokens]andL = encode(left)[−(31 − len(R)):](as trained: the left side gives way to the right side), the gap marked by<mask>(a context never holds one: replace<mask>in the text by a space first). Encode the right side on its own; English: cut the left side's trailing spaces as before. - The table's four positions. On the block's token ids
c(the 32k ids, not mapped), withgthe<mask>position (else the final<eos>):l1, l2, l3 = c[g−1], c[g−2], c[g−3],r1, r2 = c[g+1], c[g+2](−7 without a gap; indices clamped to the block); keyshash(11; l2, l1),hash(12; l3, l2, l1),hash(13; r1, r2),hash(14; l1, r1)(salts 1-4 +ngram.decoder.salt_offset10); position j = `next.mem_norm(next.mem_proj(row(key_j))- next.mem_type[j])
. Append the four afterm`: the memory is (T + 4, 256).
- next.mem_type[j])
- Each decoder layer's cross-attention keys and values are the memory through rows 256-511 and 512-767 of its
multihead_attn.in_proj_weight(and bias): compute them once per context. - Decoder input. Position 0 is
next.start; position j ≥ 1 isnext.tok_in(tok_emb[t_j]), t_j the token written at step j; plusnext.pos.weight[j]. - Layers (PyTorch
nn.TransformerDecoderLayer,norm_first=True, 4 heads of 64, LayerNorm eps 1e-5, no dropout):x += self_attn(norm1(x))with a causal mask;x += multihead_attn(norm2(x), memory)(all T + 4 positions);x += linear2(relu(linear1(norm3(x)))). Attention scale 1/8. - Read-out.
logits = next.out.1(next.out.0(x)) · tok_embᵀ + next.biasover the 32,000 tokens. A cache of each layer's self-attention keys and values makes a step cost one position.
Search (as example.py and candle_ref): beam 8, k = 5 words, at most 6 tokens a word.
- Allowed tokens: Chinese mode the
zhtokens (Simplified Han) and the end (<eos>,next_rows.jsonend); English modeen_startat the first token, thenen_contor the end. The others get −10⁹ before the log-softmax. - The end may not come first; at the 7th token only the end is allowed.
- A hypothesis that ends becomes a word: the texts of its tokens joined (
next_rows.jsontext_zh/text_en; English stripped), kept if it has at least 2 characters (completion: 1); hypotheses writing the same text are summed (log-sum-exp). - Each step keeps the 8 best open hypotheses; the search stops when 5 words are found and no open hypothesis is above the 5th.
- Completion (Chinese): put the typed characters at the end of the context; the words found are the rest of the word.
Forward pass: composition (the decoder writes the sentence)
New in 1201. The next-word decoder has a second mode: given the typed syllables, it writes the whole sentence, token by token, over the same 32k tokens.
- Sequence.
<bos> [tag] encode("已输入的上文: " + context) <eos> <mask> × syllables <eos>("已输入的上文: " = "the text typed so far: "; the context with that prefix cut to its last 39 tokens, the prefix kept; Traditional rows add the tagencode("<zh-Hant>")after<bos>). Each<mask>carries its syllable's unit inunit_ids(unified_vocab.jsonunits:f:full pinyin,p:partial pinyin (an initial),jf:/jp:Jyutping; a Zhuyin tone t = 1…5 addst × 3833), at most 24 syllables. - Encoder as for word choice (n-gram rows on the context tokens only, the prefix mask: the block up to the first
<eos>attends only to itself), without the head:h = encoder output + type_emb[0]over the whole sequence. - Memory:
m = LayerNorm(next.mem_in.0(h))over every position (the typed part too), then the table's four positions keyed around the first<eos>with nothing on its right:l1, l2, l3= the three tokens before it,r1 = r2 = −7; keys and rows as for next words. Cross-attention keys and values as for next words. - Decoder input. Position 0 is
next.start_comp(notnext.start); position j ≥ 1 isnext.tok_in(tok_emb[t_j]); plusnext.pos.weight[j]; plusnext.slot_in(h[p_j]), wherep_jis the<mask>of the first syllable the token at position j writes (the syllables written so far = the characters of the tokens before it) and, once every syllable is written, the final<eos>. The layers are the next-word decoder's. - Read-out as for next words, then every token that is not a Han token (Simplified or Traditional) or
<eos>set to −10⁴. - Search (beam 8, k = 5): a token is allowed when each of its characters is one its syllable's unit allows
(
unified_vocab.json:readingsfor Simplified Chinese (its first 6,163 characters only),ml.pinyin/ml.jyutpingfor Traditional, withoutml.simp_only;f:the full syllable,p:any syllable it starts) and it does not run past the last syllable;<eos>only once every syllable is written; at most 21 positions. Paths writing the same text are summed.
Inputs
Token ids are tokenizer.json's, with <bos> (2) as [CLS], <eos> (1) as [SEP], <mask> (4). The context, a tag
and the typed text are encoded with tokenizer.json; candidates with tokenizer.candidates.json (no ▁, English
ones too), each cut to 16 tokens. Encode without special tokens. A Traditional row starts with the tag <zh-Hant> as
plain text; Simplified Chinese and English have no tag. Characters outside the 32k tokens fall back to UTF-8 bytes
(<0x..> tokens).
word choice, Simplified (pinyin) <bos> encode(context)[last 32] <eos> <mask> × typed units <eos> cand(候选1)[:16] cand(候选2)[:16] … <eos>
word choice, Traditional <bos> encode("<zh-Hant>") encode(context)[last 32] <eos> encode(typed text)[:24] <eos> cand(候選1)[:16] … <eos>
word choice, English as Simplified, one <mask> a typed letter (its letter unit)
next word <bos> encode(context)[last 32] <eos>
next word, mid-text <bos> encode(left)[−(31 − len(R)):] <mask> R = encode(right)[:32] <eos>
composition <bos> [encode("<zh-Hant>")] encode("已输入的上文: " + context)[last 39, prefix kept] <eos> <mask> × syllables <eos>
marker_pos lists the position of each candidate's first token. Each <mask> of the typed units carries its unit in
unit_ids (unified_vocab.json units: f:san = the full syllable san, p:s = typed only partly); the other
positions have unit 0.
test_vectors.safetensors holds, for word-choice case i = 0…12, i.input_ids, i.unit_ids, i.marker_pos
(int64) and the fp32 PyTorch model's i.logits (cases 0-4 Simplified Chinese, 5-12 the first row of each Traditional
test file); for next-word case nextN, N = 0…11, nextN.input_ids (<bos> context <eos>; cases 8-11 mid-text,
<bos> left <mask> right <eos>), nextN.mode (0 Chinese, 1 English), nextN.min_chars and the fp32 model's 5 words
nextN.text (UTF-8, one word a line) with nextN.logp. The fp32 model is the one with the PQ16 table (the table as
stored), the other weights before 4 bits. For composition case compN, N = 0…4 (0-2 Simplified pinyin, 2 with initials; 3 Traditional pinyin;
4 Jyutping), compN.input_ids and compN.unit_ids (the composition sequence) and the fp32 model's 5 best sentences
compN.text (UTF-8, one a line) with compN.logp.
Accuracy
The model alone, not the IME end to end. fp32 = the PyTorch model before rounding to 4 bits (with its table as stored,
PQ16); 4-bit ONNX = the files in onnx/ (ONNX Runtime 1.30.0); Q4_0 = this file with candle_ref.
Composition (new). The sentence the decoder writes, beam 8 (example.py's search): whole sentence right / in the
5 best / characters right. The test sets of zhen-feather-1127's card: long Simplified pinyin (the dev set, full
syllables), Traditional pinyin, Zhuyin (with tones) and Jyutping from Traditional web text, and rows with a rare
character (rare chars = how often that character is right).
| Composition, fp32 (3000 rows a set) | whole | whole in 5 best | characters |
|---|---|---|---|
| Simplified, long pinyin | 50.9% | 67.3% | 83.9% |
| Traditional, pinyin | 40.3% | 54.9% | 71.3% |
| Traditional, Zhuyin | 68.5% | 83.3% | 91.4% |
| Cantonese, Jyutping | 35.9% | 51.1% | 68.1% |
| Simplified, a rare character | 5.8% | 10.1% | 43.0% (rare chars 17.1%) |
| Traditional, a rare character | 7.9% | 14.5% | 49.8% (rare chars 19.2%) |
For comparison, zhen-feather-1127 (8 layers, its own per-character composition head, a 44 MB file) on its card: Traditional pinyin 41.5 / 75.2%, Zhuyin 71.9 / 92.7%, Jyutping 37.2 / 71.3% (whole / characters).
The exported files on the first 300 rows of each set (whole sentence right / characters right; same best = the same first sentence as fp32):
| Composition (300 rows a set), whole / characters | fp32 | onnx/w4 | onnx/slim | onnx/w4-dec8 |
|---|---|---|---|---|
| Simplified, long pinyin | 50.3 / 84.3% | 44.3 / 81.8% (same best 65.7%) | 44.7 / 81.8% (65.3%) | 46.7 / 81.8% (68.7%) |
| Traditional, pinyin | 39.3 / 68.2% | 33.7 / 64.3% (same best 57.7%) | 34.0 / 64.1% (57.0%) | 34.7 / 64.8% (61.3%) |
| Traditional, Zhuyin | 65.0 / 90.0% | 60.0 / 87.9% (same best 76.3%) | 59.0 / 87.8% (76.7%) | 62.3 / 89.0% (79.0%) |
| Cantonese, Jyutping | 38.0 / 69.6% | 37.0 / 67.2% (same best 58.7%) | 37.3 / 67.4% (59.3%) | 39.0 / 67.6% (64.3%) |
| Simplified, a rare character | 12.7 / 56.3% | 12.0 / 53.2% (same best 41.3%) | 11.3 / 53.0% (41.3%) | 12.0 / 54.0% (46.0%) |
| Traditional, a rare character | 2.7 / 44.2% | 2.0 / 43.7% (same best 41.3%) | 2.0 / 43.1% (41.3%) | 3.0 / 44.4% (44.0%) |
At 4 bits composition loses about 5 points of whole sentences on the Simplified and Traditional pinyin and Zhuyin sets
(the characters 2-4 points); Jyutping and the rare-character rows hardly move. Tests with one part at a time: the
decoder's 4-bit token table (shared with the encoder's input) costs a third to a half, the 4-bit encoder most of the
rest; the
decoder's layers at 8 bits instead of 4 change nothing. onnx/w4-dec8 gives the decoder its own 8-bit table and gets
about 1-2.5 points back, for 9 MB more.
Word choice, first candidate right: every third row of the Simplified Chinese sets and the first 200 rows of each Traditional test file.
| Word choice | fp32 | 4-bit ONNX (onnx/slim) | Q4_0 (candle_ref) | Q4_0's best = fp32's |
|---|---|---|---|---|
| Simplified Chinese, words and word pairs (2175) | 86.9% | 86.6% | 86.6% | 97.4% |
| Simplified Chinese, long input (749) | 82.4% | 82.0% | 82.0% | 95.2% |
| Simplified Chinese, IME's real candidates (right word among them) (545) | 90.5% | 90.1% | 90.1% | 98.0% |
| Simplified Chinese homophones with the previous sentence (267) | 93.6% | 91.4% | 91.8% | 97.4% |
| Traditional, pinyin (luna_pinyin) (200) | 85.0% | 83.0% | 83.0% | 96.0% |
| Traditional, Zhuyin (bopomofo_tw) (200) | 86.0% | 86.5% | 86.5% | 98.0% |
| Traditional, Zhuyin (libchewing) (200) | 96.0% | 95.0% | 95.0% | 98.5% |
| Traditional, Jyutping (jyut6ping3) (200) | 87.0% | 86.5% | 86.0% | 96.0% |
| Traditional, Cangjie 5 (200) | 96.5% | 97.0% | 97.0% | 98.5% |
| Traditional, Quick 5 (200) | 96.0% | 95.5% | 95.5% | 98.0% |
| Traditional, Cangjie 3 (200) | 78.0% | 80.0% | 80.0% | 96.0% |
| Traditional, Quick 3 (200) | 75.0% | 75.5% | 75.5% | 95.0% |
Next word: the text's next word first (@1) / among the 5 words (@5), the model alone (no n-gram), beam 8; the first 200 rows of the Chinese and English next-word test sets, the first 100 mid-text rows of each (the rows whose text goes on after the word, that text as the right side) and 100 Chinese words cut after their first characters (completion). Small sets: a row is half a point or a whole one.
| Next word | fp32 | 4-bit ONNX (onnx/slim) | Q4_0 (candle_ref) | Q4_0's first word = fp32's |
|---|---|---|---|---|
| Simplified Chinese (200) | 13.0 / 20.5% | 12.0 / 20.5% | 12.0 / 20.5% | 72.5% |
| English (200) | 18.5 / 38.5% | 18.0 / 38.5% | 18.0 / 38.5% | 77.5% |
| Chinese mid-text (100) | 16.0 / 27.0% | 14.0 / 24.0% | 14.0 / 24.0% | 61.0% |
| English mid-text (100) | 26.0 / 41.0% | 26.0 / 39.0% | 26.0 / 39.0% | 73.0% |
| Chinese completion (100) | 45.0 / 62.0% | 44.0 / 60.0% | 43.0 / 60.0% | 83.0% |
The 4-bit file and the 4-bit ONNX graph agree with each other almost row for row; against fp32 they move a few scores
(word choice: the same best candidate in 95.0-98.5% of rows; on the 13 vectors the same best in 13/13, logits within
0.965; next word: the same first word in 7 of the 12 vectors, 3.6 of the 5 words shared on average). onnx/w4-dec8
moves next words a little less (the first token the same as fp32's in 75.3% of 300 contexts instead of 73.3%).
On the full next-word test sets (PyTorch fp32, the tables as PQ16; mid-text = the test rows whose text goes on after
the word), against zhen-mini-loop-1130 (its single-character update). "Any" = the 3,548 Chinese test positions with
min_chars=1, the text's real next unit as the answer, a single character at 1,489 of them; the other rows are words of
two or more characters (min_chars=2):
| @1 / @5 | zhen-mini-loop-1130 | zhen-mini-1201 |
|---|---|---|
| Chinese, single characters (1489) | 24.3 / 42.7% | 25.2 / 44.3% |
| Chinese, any next unit (3548) | 16.6 / 30.6% | 16.4 / 30.4% |
| Chinese mid-text | 15.0 / 28.2% | 13.5 / 26.0% |
| English mid-text | 29.7 / 48.4% | 26.9 / 45.0% |
| Chinese next word | 11.4 / 22.3% | 11.2 / 21.6% |
| ... with ng1017 | 12.3 / 24.7% | 11.7 / 23.4% |
| English next word | 20.5 / 39.0% | 19.9 / 37.1% |
| ... with a trigram of the training text | 21.2 / 40.0% | 20.3 / 38.1% |
| Chinese completion | 51.4 / 73.7% | 49.4 / 71.8% |
Word choice on the full test sets (PyTorch fp32, first candidate right), where the two differ by more than half a point:
| zhen-mini-loop-1130 | zhen-mini-1201 | |
|---|---|---|
| Simplified Chinese, long input (1425) | 82.5% | 81.6% |
| Simplified Chinese web text, short input (882) | 91.1% | 90.0% |
| Simplified Chinese web text, long input (233) | 87.5% | 86.3% |
| English web text (426) | 85.7% | 86.4% |
| Traditional, Quick 5 | 96.4% | 95.5% |
On the public neutral word-choice test sets (v2, v3 web, v4 chat, v5 hard; whole page, first candidate right):
| v2 | v3 | v4 | v5 | |
|---|---|---|---|---|
| zhen-mini-next-preview-1116, PyTorch fp32 | 93.63% | 93.37% | 91.31% | 70.65% |
| zhen-mini-next-1123, PyTorch fp32 | 92.86% | 93.11% | 92.31% | 69.58% |
| zhen-mini-next-1126, PyTorch fp32 | 93.01% | 93.18% | 92.29% | 71.55% |
| zhen-mini-next-1129, PyTorch fp32 | 93.42% | 93.26% | 92.47% | 71.15% |
| zhen-mini-loop-1130, PyTorch fp32 | 93.67% | 93.63% | 92.45% | 71.51% |
| zhen-mini-1201, PyTorch fp32 | 92.98% | 93.31% | 92.30% | 70.98% |
zhen-mini-next-preview-1116, 4-bit ONNX (onnx/w4) | 93.2% | 93.2% | 91.1% | 70.4% |
zhen-mini-next-1123, 4-bit ONNX (onnx/w4) | 92.7% | 92.8% | 92.2% | 69.3% |
zhen-mini-next-1126, 4-bit ONNX (onnx/w4) | 92.8% | 92.9% | 92.2% | 71.4% |
zhen-mini-next-1129, 4-bit ONNX (onnx/w4) | 93.2% | 92.9% | 92.2% | 71.1% |
zhen-mini-loop-1130, 4-bit ONNX (onnx/w4) | 93.5% | 93.3% | 92.2% | 71.8% |
zhen-mini-1201, 4-bit ONNX (onnx/w4) | 92.6% | 93.1% | 92.2% | 71.5% |
v5 by the context before the typed text (PyTorch fp32; none / 1-16 characters / more):
| none | 1-16 characters | more | |
|---|---|---|---|
| zhen-mini-next-preview-1116 | 61.33% | 69.43% | 82.91% |
| zhen-mini-next-1123 | 58.63% | 70.79% | 80.86% |
| zhen-mini-next-1126 | 62.05% | 72.52% | 81.43% |
| zhen-mini-next-1129 | 59.96% | 73.01% | 81.95% |
| zhen-mini-loop-1130 | 60.29% | 73.77% | 81.88% |
| zhen-mini-1201 | 59.29% | 73.17% | 81.95% |
The ONNX rows are the comparison scorer's (the charts below), the fp32 rows the training code's; the two count the same rows slightly differently.
candle_ref (loads the file in about 0.1 s):
cd candle_ref
RUSTFLAGS="-C target-cpu=native" cargo build --release
target/release/zhiyi-ref ../model.safetensors ../test_vectors.safetensors out.safetensors
candle's quantized kernels choose their SIMD code at compile time: build with RUSTFLAGS="-C target-cpu=native" (or
at least x86-64-v3). candle_ref is a reference, not a fast runtime: it runs the whole sequence with the mask (no
cache) and reruns the decoder over each hypothesis' prefix at every step; the outputs are those of the cached runs. It
does word choice and next words; the composition cases (comp*) in test_vectors.safetensors are skipped.
Compared with other input-method models
Each model alone (no engine, no n-gram add-on), on three tasks: the neural input-method models under 1B parameters we could run, and one large-model reference, Qwen3.5-2B-Base (zero-shot, run through VimeML's own search code). Of the Zhiyi models only the four maintained ones are shown: pumpkin (zhiyi-ml-pumpkin), Flash (zhiyi-ml-flash-0.2B), Mini (this model) and Feather (zhiyi-zhen-feather), scored in PyTorch with the released weights, so the points can differ a little from the numbers above. Models far behind are left out and named under each chart. The word-choice models (the file of each, its license and how it is run) and their scoring code: https://github.com/dd1000001000/zhiyi_models/tree/main/comparisons/models
- Word choice: pick the original text among one engine's candidates, on the public neutral test sets v2–v5 (v5: the hard cases).
- Composition: a whole pinyin string to a sentence, first output exactly right. Every target is typed four ways (full pinyin, last syllable cut short, full and initials mixed, initials only), with the text before it as context: web paragraphs from October 2026 (2,000 rows) and LCCC test dialogues (1,800 rows).
- Next word: the next word (2+ characters) is among the top 5 predictions: web (6,000 rows) and LCCC test dialogues (4,943 rows).
The composition and next-word sets are new (December 2026) and not published yet.
For each task the first chart ranks the models (bars from 0, with parameters and compute per row), the second puts the score against compute per row (log scale): green is the most attractive quadrant (at most the median compute and at least the median score), the dotted line the Pareto front (no other model at least as good on both axes). Word choice: the theoretical multiply-adds to score a row's candidates (the context once, then each candidate). Composition and next word: the multiply-adds of each model's own pipeline (its search and beams), counted with PyTorch's FLOP counter on a sample of about 100 rows per set; pipelines that rerun whole sequences are counted as with a KV cache. N-gram table lookups are not counted.
Word choice
Composition
Next word
License and credits
These weights are Zhiyi IME's own work and are licensed under the Apache License 2.0 (LICENSE). The reference
code in candle_ref/ is GPL-3.0-only, like Zhiyi IME (https://github.com/dd1000001000/zhiyi_ime/blob/main/LICENSE).
The upstream parts keep their licenses: the Laya architecture (https://huggingface.co/convaiinnovations/laya)
Apache-2.0, the mmBERT-small encoder and tokenizer (Marone et al., 2025; https://huggingface.co/jhu-clsp/mmBERT-small)
MIT (the 32k tokenizer is a subset of its vocabulary). The n-gram table follows the idea of hashed n-gram embeddings
read beside a transformer (Engram-style conditional memory); the design and the code here are Zhiyi's own.
Teachers (only their scores and words were used; none of their weights are in these files): Zhiyi's own 8-layer model (zh-lite-next-preview's Lite x8) online for word choice; Qwen3.5-9B (https://huggingface.co/Qwen/Qwen3.5-9B) fine-tuned with LoRA for word choice (stored scores) and Qwen3-1.7B-Base (https://huggingface.co/Qwen/Qwen3-1.7B-Base) for next words, both by the Qwen team (Alibaba Cloud), Apache-2.0. Next-word text: Chinese text of C4 (Raffel et al.) and LCCC, English text of FineWeb (CC-MAIN-2025-26) and C4. The pre-training text (from 1129): FineWeb-2 (cmn_Hani, yue_Hani), FineWeb, LCCC, CSL and SODA. The short-context word-choice rows (from 1126): Chinese text of FineWeb-2 (cmn_Hani), LCCC and C4, their candidates from seven input-method engines run on the typed letters (Zhiyi, Rime with rime-ice and with luna_pinyin, libpinyin, libime, Qingjian and Microsoft Pinyin; only their candidate lists were used). The composition rows (from 1201): zhen-feather-1127's (as ML-Flash-1103's: SkyPile-150B, LCCC, C4, SODA, Tatoeba, FineWeb, FineWeb-2, the Cantonese Wikipedia; rare-character rows from FineWeb-2; readings from pypinyin, OpenCC and librime with the Rime schemas, rime-cantonese among them); the natural-mix next-word rows are zhen-feather-1127's. These programs and data only produced training rows; none of them is in these files.