Qwen3.5-0.8B-zh-en-novel
Chinese → English translation of web novels with a 0.8B model. Qwen/Qwen3.5-0.8B after one epoch of
supervised fine-tuning on translations made by Index-Translate-9B (single lines) and
Index-Translate-35B-A3B (windows of 3–5 lines). It uses the Index
prompt format: it keeps the line count of a window, follows a term glossary (中文 → English), and follows a gender note for a character.
Quality, in short. On our web-novel test sets it is behind Index-Translate-2B by about 3–4 points of "bad" lines and 5 points of "wrong" lines (table below), and ahead of it on line keeping and on following gender notes. All numbers come from an LLM judge, not from human review. Use it where a model smaller than 2B matters more than the last points of quality.
Decode with the token ban. Ban the token ids in banned_token_ids.json (tokens with a non-Latin script — Han, kana, Hangul,
Cyrillic, … — and byte fragments). Without the ban, 3.5 % of the output lines keep untranslated Chinese words; with it, 0 %, and the
judged quality does not change (P-600 bad +0.5 points, CI [−0.7; +1.7]; G2 wrong −2.3 points, CI [−5.0; +0.3]).
Try it in the browser. The Space DanVP/Qwen3.5-0.8B-zh-en-novel-demo runs the Q6_K file of this repo on your own GPU (llama.cpp through wllama, WebGPU), with the prompt formats, window split and token ban below. The first visit downloads about 636 MB. Measured speed: about 13 tokens/s on an the integrated Intel Graphics (Xe-LPG) of a Core Ultra 9 275HX and about 70 tokens/s on an RTX 5070 Ti Laptop GPU.
Files
| File | Size | Use |
|---|---|---|
model.safetensors (+ model-extra.safetensors: the MTP head of the base) | 1.75 GB | transformers / vLLM, bf16. The vision tower is the base model's, unchanged and not evaluated |
Qwen3.5-0.8B-zh-en-novel-BF16.gguf | 1.52 GB | llama.cpp, text only |
Qwen3.5-0.8B-zh-en-novel-Q8_0.gguf | 0.81 GB | llama.cpp |
Qwen3.5-0.8B-zh-en-novel-Q6_K.gguf | 0.63 GB | llama.cpp |
Qwen3.5-0.8B-zh-en-novel-Q4_K_M.gguf | 0.53 GB | llama.cpp |
banned_token_ids.json | 103,492 token ids to ban at decode time | |
prompts.py | the exact prompt formats of training (build_prompt, render, split_windows) |
GGUF files: llama.cpp b12015, convert_hf_to_gguf.py --outtype bf16 --no-mtp, then llama-quantize without an importance matrix.
Evaluation
Judge: Claude Haiku 5.5, blind to the system, all systems in one shuffled batch; each output judged 3 times, label = majority. Paired difference, bootstrap 10,000, 95 % CI. Sets: P-600, 600 held-out lines from the training pool (judge: is the translation faithful? "bad" = omission, addition or mistranslation); G2-J300, 300 lines of the GuoFeng web-novel test set judged against the human reference (correct / minor / wrong); G2 chapters, 179 windows of 3–5 lines; glossary probe, 200 lines with a gender note for one character, each in both genders.
| This model (bf16, vLLM, ban) | Index-Translate-2B | Difference | |
|---|---|---|---|
| P-600 bad | 9.67 % | 6.00 % | +3.67 [+1.00; +6.33] |
| G2-J300 wrong | 16.33 % | 11.33 % | +5.00 [+0.67; +9.33] |
| G2-J300 correct | 48.33 % | 56.33 % | −8.00 [−13.67; −2.33] |
| Chapter windows with the right line count | 100 % | 97.2 % | |
| Lines with Han characters (1,816 lines) | 0 % | 0.72 % | |
| Glossary probe: follows the requested gender (he / she) | 90.0 % / 87.0 % | 85.0 % / 84.0 % |
Errors that remain are mostly in reading the Chinese: idioms and slang, rhetorical questions read as real questions, who does what to whom, rare characters, long sentences.
GGUF quantization (llama.cpp CPU, greedy, ban; difference to the BF16 GGUF)
| File | P-600 bad | G2-J300 wrong | Window line count | CPU tok/s (1 stream / 8 slots) |
|---|---|---|---|---|
| BF16 | 11.33 % | 16.00 % | 100 % | 38.8 / 86 |
| Q8_0 | −0.33 [−1.83; +1.17] | +1.33 [+0.33; +2.67] | 100 % | 61.5 / 105 |
| Q6_K | +0.33 [−1.33; +2.17] | −0.67 [−3.00; +1.67] | 100 % | 68.3 / 115 |
| Q4_K_M | +1.17 [−0.83; +3.00] | +4.33 [+0.67; +7.67] | 100 % | 74.9 / 122 |
CPU: Intel Core Ultra 9 275HX, 16 threads. Q6_K shows no measurable loss; Q4_K_M loses about 4 points on the G2 wrong rate. The BF16 GGUF and the bf16 vLLM model give the same judged quality (P-600 bad +0.17, CI [−1.0; +1.3]).
Prompt format
No system prompt, and the empty think block of the Qwen3.5 template (enable_thinking=False). prompts.render() builds the same string.
Single line:
请将以下中文文本翻译为英语,直接输出翻译结果,不要进行任何解释。\n\n{line}
Window of 2–5 lines (keeps the line count), optional glossary and gender note:
请将以下中文小说翻译成英语,并且严格遵循所有约束要求。
【源文】
{line 1}
{line 2}
【约束要求】
1. 【硬性要求】保持与源文相同的行数,逐行对应,不要合并或拆分行
2. 【注意】这是小说的叙述文字,请使用过去时叙述;人物对话和引文内的时态保持自然
3. 【硬性要求】专名/术语对照: 林君→Lin Jun、呵呵→Hehe
4. 【注意】人物性别:林君为男性,用 he/his
只输出译文,不要有任何额外说明。
For a chapter, split the text into windows of at most 5 lines (prompts.split_windows). Max new tokens: 512 for a line; 3 × source
tokens + 64 for a window. Stop on <|im_end|> (248046) or <|endoftext|> (248044). Greedy decoding.
Usage
llama.cpp
llama-server -m Qwen3.5-0.8B-zh-en-novel-Q6_K.gguf -c 4096
# pip install huggingface_hub requests; put prompts.py and banned_token_ids.json next to this script:
# huggingface-cli download DanVP/Qwen3.5-0.8B-zh-en-novel prompts.py banned_token_ids.json --local-dir .
import json, requests
from prompts import build_prompt, render
ban = [[i, False] for i in json.load(open("banned_token_ids.json"))]
body = {"prompt": render(build_prompt(["他来了。"])), "n_predict": 512, "temperature": 0, "top_k": 1,
"stop": ["<|im_end|>", "<|endoftext|>"], "logit_bias": ban, "cache_prompt": False}
print(requests.post("http://127.0.0.1:8080/completion", json=body).json()["content"])
Our evaluation sent the prompt as token ids from the Hugging Face tokenizer (tokenizer(render(p), add_special_tokens=False)).
transformers
# prompts.py and banned_token_ids.json from this repo next to the script (see the llama.cpp example)
import json, torch
from transformers import AutoTokenizer, Qwen3_5ForConditionalGeneration
from prompts import build_prompt, render
repo = "DanVP/Qwen3.5-0.8B-zh-en-novel"
tok = AutoTokenizer.from_pretrained(repo)
model = Qwen3_5ForConditionalGeneration.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
ban = json.load(open("banned_token_ids.json"))
lines = ["林君脸上不喜不忧,一脸平淡。", "“白校长,看我又带一个回来了!”"]
ids = tok(render(build_prompt(lines, window=True)), add_special_tokens=False, return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=256, do_sample=False, suppress_tokens=ban)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))
vLLM
SamplingParams(temperature=0, allowed_token_ids=[ids not in banned_token_ids.json]). vLLM 0.29 caps allowed_token_ids at 1,024 ids in
its default (V2) model runner; set VLLM_USE_V2_MODEL_RUNNER=0 to use the V1 runner, which masks the full vocabulary.
Training
- Full fine-tuning of the text decoder (vision tower frozen), 1 epoch: 1,679,724 samples, 216.8M tokens, 13,123 steps of 128 samples.
- AdamW (0.9, 0.95), weight decay 0.01, LR 2e-5 with 300 warmup steps and cosine decay to 2e-6, gradient clip 1.0, fp32 master weights
with bf16 autocast. Loss on the target tokens and the closing
<|im_end|>. Dev cross-entropy 0.504 at the end. - Data: Chinese web-novel lines (xianxia, fantasy, urban and other genres). Targets by Index-Translate-9B (single lines) and Index-Translate-35B-A3B-preview (windows of 3–5 lines), with punctuation, quotes and character names normalized. Some samples carry a term glossary; some carry a gender note, including samples whose pronouns were flipped so that the note is a real instruction.
- One Colab GPU (RTX PRO 6000, 96 GB), about 3 hours.
- An on-policy distillation pilot from Index-Translate-9B after this SFT (94 steps) did not improve the judged quality; this release is the SFT checkpoint.
Limitations
- Reading errors on idioms, slang, rare characters and long sentences (see Evaluation). Check important text.
- Evaluated only with an LLM judge; no human review.
- Trained and evaluated on Chinese → English web fiction; other domains and directions are not tested.
- Image input comes from the base model and was not evaluated.
License and credits
Apache-2.0. Base model: Qwen3.5-0.8B (Qwen team, Apache-2.0). Training targets were produced with Index-Translate-9B and Index-Translate-35B-A3B-preview (bilibili Index team, Apache-2.0).
Tóm tắt tiếng Việt
Model 0.8B dịch truyện mạng Trung → Anh, SFT từ Qwen3.5-0.8B trên bản dịch của Index-Translate-9B / 35B. Kém Index-Translate-2B khoảng 3–4
điểm dòng sai (đánh giá bằng judge LLM), hơn ở giữ số dòng và theo ghi chú giới tính. Luôn decode với danh sách token cấm
banned_token_ids.json để loại chữ Hán sót. Bản GGUF: Q6_K không thấy giảm chất lượng; Q4_K_M giảm khoảng 4 điểm ở tỉ lệ dòng sai của G2.
Dùng thử trong trình duyệt: Space DanVP/Qwen3.5-0.8B-zh-en-novel-demo
chạy bản Q6_K trên GPU của máy bạn (WebGPU), lần đầu tải khoảng 636 MB.