naxi-qwen3.5-4b-v6
Part of NaxiAI — a digital preservation project for the Naxi language (纳西语), with a bilingual dictionary, a digitised library and a place-name gazetteer.
Dictionary · Digital library · Place-name gazetteer · Models and benchmarks · NTQS leaderboard
Background: what Naxi is · Naxi pinyin · the Harvard-Yenching Dongba manuscripts (Li & Peters 2024, doi:10.1177/25138502241300182).
A fine-tuned model for Naxi ↔ Chinese ↔ English translation.
Naxi (纳西语, ISO 639-3
nxq) is a Sino-Tibetan language of the Lijiang region, Yunnan, China, with roughly 300,000 speakers. UNESCO classifies it as vulnerable. There is essentially no digital infrastructure for the language: no mainstream keyboard, no machine translation service, no pretrained NLP models.
This is the successor to Apeters247/naxi-qwen3-14b-v5,
which was the first publicly released LLM fine-tuned for Naxi. It is not a
retrain of v5 — it is a different base model (Qwen3.5-4B rather than
Qwen3-14B), a different tokenizer strategy, and a different evaluation
instrument. Read §1 before assuming the numbers in this card are comparable to
v5's.
1. Relationship to v5, and a warning about the numbers
What is genuinely better than v5:
| v5 | v6 (this model) | |
|---|---|---|
| Base | Qwen3-14B | Qwen3.5-4B |
| Weights | LoRA adapter only | Merged full weights |
| Tokenizer | stock Qwen | +633 Naxi syllable tokens |
| Serving cost | ~14B params | ~4.8B params (≈3× fewer parameters, so roughly 3× less compute per token) |
| Eval instrument | NTQS 82.3 / chrF 56.08 (composite) | frozen 446-row gate, chrF++, clustered bootstrap CIs |
| Reproducibility | score not independently reproducible | per-row predictions + CIs shipped in this repo |
We re-ran v5 on this instrument so the comparison is measured, not asserted.
The v5 card reports NTQS 82.3 and chrF 56.08. Those come from a
different harness — a composite score over a mixed task set including dictionary
lookup, phonological recognition and template generation — and they are not
comparable to chrF++ on a translation gate. Rather than leave that as a
footnote, we downloaded v5 from this Hub, applied its adapter to its stated base
(unsloth/Qwen3-14B), and ran it over the identical 446-row gate with the
identical prompt contract, decode settings and scorer.
Measured head-to-head (446 rows, chrF++, clustered bootstrap):
| model | corpus chrF++ | vs v5 (corpus) | row Δ vs v5 | 95% CI | W/L |
|---|---|---|---|---|---|
v5 (naxi-qwen3-14b-v5, 14B) | 30.41 | — | — | — | — |
production nxkd1-K (4B) | 45.47 | +15.06 | +19.11 | [+15.99, +22.20] | 345W / 82L |
| v6 (this model) | 45.74 | +15.33 | +19.91 | [+16.87, +23.01] | 356W / 71L |
Corpus chrF++ and per-row Δ differ because corpus score weights by output length while row Δ weights every sentence equally. Both point the same way; the row-level comparison is the more conservative read of consistency.
The same three systems under NTQS (the metric v5's card used), scored on the identical 446 rows with the same references:
| model | NTQS total | tone /30 | semantic /35 | dialect /20 | complete /15 |
|---|---|---|---|---|---|
| v5 | 56.73 | 16.14 | 17.36 | 10.19 | 13.04 |
prod nxkd1-K | 68.69 | 17.96 | 26.82 | 10.58 | 13.34 |
| v6 | 69.05 | 17.91 | 27.37 | 10.58 | 13.18 |
| comparison | Δ NTQS | 95% CI | W/L | verdict |
|---|---|---|---|---|
| v6 vs v5 | +12.32 | [+10.58, +14.08] | 332W / 81L | improvement |
v6 vs prod nxkd1-K | +0.35 | [−0.58, +1.29] | 103W / 92L | inconclusive |
prod nxkd1-K vs v5 | +11.97 | [+10.19, +13.73] | 321W / 89L | improvement |
Both metrics agree on the ordering and on the verdicts. v6 beats v5 by a wide, significant margin under chrF++ (+19.91) and NTQS (+12.32); v6's edge over production is within noise under both. That agreement matters — chrF++ rewards getting the sentence right, NTQS rewards producing valid Naxi with correct tone letters and adequate length, and they are not measuring the same thing. When two instruments with different failure modes rank the models the same way, the ranking is more trustworthy than either alone.
Per stratum (NTQS total):
| stratum | n | v5 | prod nxkd1-K | v6 |
|---|---|---|---|---|
| everyday | 382 | 57.9 | 70.9 | 71.3 |
| grammar_lit | 43 | 55.5 | 62.0 | 62.4 |
| rag_eligible | 21 | 37.7 | 43.1 | 41.6 |
Note rag_eligible is the one stratum where production edges v6 under NTQS
(43.1 vs 41.6), while chrF++ has them essentially level (8.6 vs 8.4). n=21, so
neither difference is established.
Per stratum (chrF++), same 446 rows:
| stratum | n | v5 | prod nxkd1-K | v6 |
|---|---|---|---|---|
| everyday | 382 | 31.6 | 52.8 | 53.7 |
| grammar_lit | 43 | 24.2 | 32.3 | 32.7 |
| rag_eligible | 21 | 5.3 | 8.6 | 8.4 |
So: v6 is roughly 15 chrF++ ahead of v5 on a like-for-like instrument, at one-third the parameter count. That is a large, consistent gap across every stratum and both directions (v5: 29.6 en→naxi / 29.7 zh→naxi; v6: 47.6 / 51.9).
We are stating this plainly because it is a genuinely strong result, and because the earlier version of this card hedged without evidence. The hedge was wrong: we now have the measurement. What we still do not claim is that v5's NTQS 82.3 was wrong — it measured something else. NTQS rewards tone completeness and phonological validity; a model can score well there and still be beaten on sentence-level translation adequacy, which is what chrF++ measures. Both can be true at once.
For completeness, the production model v6 replaces is not v5 — it is a smaller
4B Qwen3.5 arm from the same lineage (nxkd1-K), which v6 is a three-seed weight
average of. Against that, v6's gain is within noise (§3).
2. Fine-tuning approach
Base model. Qwen3.5-4B-Base. Hybrid architecture: 32 layers, alternating
linear-attention and full-attention blocks (full_attention_interval: 4),
hidden size 2560, head dim 256, untied embeddings.
Vocabulary extension — the central design choice. Naxi romanisation is
syllable-structured, and stock Qwen tokenisation shatters Naxi words into
sub-syllabic fragments, inflating sequence length and wasting capacity on
recomposing syllables the model should treat as atoms. We added 633 tokens
covering the Naxi syllable inventory, taking the vocabulary from 248,044 to
248,670. Because the new embedding rows start as noise, embed_tokens and
lm_head are kept trainable (modules_to_save) rather than frozen.
LoRA.
| parameter | value |
|---|---|
| rank | r=256 |
| alpha | 2r (512) |
| dropout | 0.05 |
| RS-LoRA | enabled |
| init | Gaussian (PiSSA and DoRA were tested and are off) |
| bias | none |
| trainable extras | embed_tokens, lm_head (vocab extension) |
Training.
| parameter | value |
|---|---|
| rows | 50,042 (train_nxkd1_K.jsonl, sha256 2888db9a…) |
| epochs | 3 |
| effective batch | 32 (8 × grad-accum 4) |
| LR | 1.5e-4, cosine, 5% warmup |
| optimiser | AdamW 8-bit (adamw_bnb_8bit) |
| precision | bf16 |
| seq length | 1280 |
| seed | 42 |
Why 1280 and not 512. Measured on the real tokenizer, this corpus has mean 209 tokens, p99 745, max 1251. At a 512 cap, 6.4% of examples were truncated — and the collator truncates from the end, which cut the tail off Naxi targets and taught the model to stop early. 1280 removes that. With length-grouped batching the extra window costs almost nothing.
Three-seed averaging. The released weights are the arithmetic mean of three independently seeded runs (s42, s43, s44), averaged in fp32 and stored as bf16. Weight averaging is cheap and, here, positive — see §3. It is not an ensemble: it is a single set of weights, so it costs nothing at inference.
Serving contract. The chat template opens generation inside </think>. Some
Ollama builds return the translation in the reasoning field with an empty
content field on the OpenAI-compatible endpoint; handle both. This is
documented in chat_template.jinja.
3. Evaluation
Evaluation standard. Every Naxi model in this series is scored on both chrF++ and NTQS, on the same frozen gate, with the same prompts and decode. Report one without the other and the number is not interpretable — they fail in different ways. Harness, per-row predictions and full results:
Apeters247/naxi-mt-benchmark.
Instrument. A frozen 446-row translation gate (promotion_gate_v1), scored
with chrF++ (sacrebleu, word_order=2). Significance is a bootstrap clustered
by reference (260 clusters, 2000 resamples) — rows sharing a reference are not
independent, and an unclustered CI here would be roughly half as wide and
overstate confidence.
Baselines are the production model nxkd1-K (seed 42 alone) and, separately,
v5 re-evaluated on this same instrument.
Against production nxkd1-K (446 leak-free rows):
| comparison | Δ chrF++ (row) | 95% CI | W/L | verdict |
|---|---|---|---|---|
v6 vs prod nxkd1-K | +0.80 | [−0.67, +2.25] | 116W / 105L | inconclusive |
| everyday | — | — | — | 53.7 vs 52.8 |
| grammar_lit | — | — | — | 32.7 vs 32.3 |
| rag_eligible | — | — | — | 8.4 vs 8.6 |
Against v5 (446 leak-free rows, both re-measured today):
| comparison | Δ chrF++ (row) | 95% CI | W/L | verdict |
|---|---|---|---|---|
| v6 vs v5 | +19.91 | [+16.87, +23.01] | 356W / 71L | large improvement |
v5 vs prod nxkd1-K | −19.11 | [−22.20, −15.99] | 82W / 345L | regression |
The honest reading, in two parts.
Versus v5, this is a large and unambiguous win: +19.91 chrF++ per row, CI [+16.87, +23.01], 356 wins to 71 losses, consistent across every stratum and both translation directions. At one-third the parameters. That is the headline.
Versus the current production model, the gain is +0.80 chrF++ with a CI of [−0.67, +2.25] — it does not clear significance. The CI includes zero. All three strata lean slightly positive and win/loss leans positive (116/105), which is why we shipped it, but we are not going to call it certified. If what you need is a certified improvement over the current 4B production model, this is not it yet — and §5 says why.
Both statements are true simultaneously. v6 is a big step over the published v5 and a small, unproven step over what we run in production.
Per-row predictions for the gate are included so you can re-score independently.
Why does v5's card say NTQS 82.3 while we measure 56.73? Three separate reasons, and none of them is that v5's authors were wrong:
- Task mix. v5's 82.3 was averaged over its own suite, which is 78%
generation tasks plus dictionary and phonological items, with
reverse_en/reverse_zhupsampled 3×. Our gate is only translation. A dictionary lookup or an IPA↔Pinyin conversion scores very differently from a full sentence translation, and v5 is strongest on those. - The scorer lost a component and changed weights. v5's card defines NTQS with five components: Tone/25, Semantic/30, Loanword Handling/15, Dialect/15, Complete/15. The scorer that exists today has four — Tone/30, Semantic/35, Dialect/20, Complete/15 — with Loanword Handling removed (its code comment explains why: it was keyword-matching on the literal strings "loanword"/"借词" in output, which is not a meaningful signal for translation output). Recomputing our four-component numbers under the old 25/30/15/15 weights moves each model by about +1 point, so the reweighting is real but small. The removed component is the larger unknown: we cannot reproduce v5's exact 82.3 without the original five-component scorer and its task suite.
- Tone scoring changed. The current scorer credits valid mid-tone syllables
(no explicit marker), not just explicit
l/q/fmarkers. That was a deliberate fix to stop under-scoring correct mid-tone output.
The honest summary: v5's 82.3 and our 56.73 are not the same measurement. What is directly comparable is the table above, where all three models were run through the identical gate, identical prompts, identical decode, and scored by the identical scorer version. On that, v6 is +12.32 NTQS ahead of v5.
This also means NTQS should not be used to compare across base models or across scorer versions without re-running both sides. It was designed for within-lineage tracking on a fixed task mix, where it worked.
4. What we learned building this
These are the findings that actually changed decisions. Several killed attractive ideas.
Ensembling does not pay. We tested MBR (minimum Bayes risk) selection over six seed systems. It scored +0.884 on the gate — with a CI of [−0.39, +1.93] that crosses zero — for 6× the decode cost. Worse, the chrF-medoid selector picked the row-optimal candidate only 49.8% of the time, while an oracle over the same pool would have scored +10.16. So 11.3 of the 12.7 available points sit on the table, and the bottleneck is selection, not generation. That is a verifier problem, and it is where the next real gain lives.
Scale is dead. Per-seed paired deltas from 4B to 9B: +0.88 / +0.24 / −0.15. The headline "+0.88" was one seed. Across seeds, more parameters bought nothing. This is why the release is 4B, not 9B or 14B.
A plausible bug that wasn't the bug. We believed a 200-token output cap was causing a −3.0 regression on long inputs. Measured against actual reference lengths: only 20 of 6,020 (0.3%) references exceed the cap. The cap is a real defect and it is free to fix, but it explains a rounding error, not the regression. That regression is still unexplained, and at n=21 the stratum's own minimum detectable effect is ~7.9 chrF — so even its sign isn't established.
DPO did nothing. A DPO sweep on the seed checkpoints moved the gate by +0.26 to +0.35 row-delta with CIs spanning zero, at 23W/23L and 26W/22L. Not shipped.
Your test set is not clean. 276 of the 446 gate rows (61.9%) have a reference that is a verbatim sentence from the gold set, and 76.4% of gold rows are also gate prompts. Only 8 rows are clean on both sides. This is a structural weakness of the whole measurement scheme, not just this model: the gate is not independent of the only human-verified data we have. Treat all numbers in this card with that in mind — it is why we report CIs rather than point scores, and why the 3-seed average (a variance-reduction trick) is the honest way to ship a small effect.
5. Known limitations
- Not certified. The gain over production is within noise (§3).
- Gate contamination as described above.
rag_eligiblestratum is small (n=21) and its behaviour is unexplained.- Directional coverage is uneven. Naxi→EN and Naxi→ZH are stronger than the reverse; the corpus is richer in Naxi sources than Naxi targets.
- Lexicon gaps remain. Independent sampling found roughly 44% of lexemes in held-out Naxi text are unattested in the training corpus. No amount of fine-tuning fixes that; it is a data-collection problem.
- Dialect. Trained predominantly on the Common/Lijiang variety (COM). Other varieties (LJ, WH, LQ, BD) are present but thin.
- Non-commercial licence (inherited from the base model).
- No GGUF in this repo yet. Conversion of this hybrid linear-attention architecture needs a llama.cpp version newer than the one we had at release time. Merged safetensors are provided so you can convert with a current llama.cpp; we will add GGUF when that lands.
6. Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
repo = "Apeters247/naxi-qwen3.5-4b-v6"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16,
device_map="auto", trust_remote_code=True)
messages = [
{"role": "system", "content": "You are a Naxi language translation assistant. "
"You translate between Naxi, Chinese, and English. "
"Naxi output uses standard Naxi Pinyin, default "
"dialect COM, with SOV word order."},
{"role": "user", "content": "Translate to English:\nngv zzeeq ddv"},
]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
out = model.generate(**tok(text, return_tensors="pt").to(model.device),
max_new_tokens=256, do_sample=False)
print(tok.decode(out[0][tok(text, return_tensors="pt").input_ids.shape[1]:],
skip_special_tokens=True))
Prompting notes. Use the system prompt above — the model was trained with it.
State the direction explicitly. For dictionary-style lookups, supplying
[dialect: COM, tone: ³³, pos: n]-style hints matches the training format.
7. Citation
@misc{peters2026naxiv6,
title = {naxi-qwen3.5-4b-v6: A Naxi translation model},
author = {Peters, Kevin},
year = {2026},
note = {Base model: Qwen3.5-4B. Successor to naxi-qwen3-14b-v5.},
url = {https://huggingface.co/Apeters247/naxi-qwen3.5-4b-v6}
}
8. Licence
CC BY-NC 4.0, inherited from Qwen3.5-4B. Research and non-commercial use. For commercial licensing of Naxi language technology, contact the project at naxiai.com.
Questions and corrections
Corrections to the numbers on this card are welcome, and are the reason the per-row predictions are shipped with the model. Open a discussion on the Community tab of this repository, or write to anp8875@g.harvard.edu.