Bilibili Zh→En Lightweight Distilled Models (Qwen3-0.6B GGUF & opus-mt-zh-en ONNX)
Two lightweight Chinese-to-English (zh -> en) translation student models fine-tuned on 3,992 real Bilibili danmaku and comment pairs (3,792 train / 200 val, excluding held-out test videos) distilled from IndexTeam/Index-Translate-2B-GGUF.
Included Models
| Path | Base Model | Format | Size | Best For | License |
|---|---|---|---|---|---|
bili-zh-en-qwen3-0.6b-Q4_K_M.gguf | Qwen/Qwen3-0.6B | GGUF (Q4_K_M) | 378.3 MiB (~379 MB) | GPU / Vulkan / Metal / CUDA (llama.cpp, node-llama-cpp, Ollama) — much better Bilibili slang & brand recognition | Apache 2.0 |
opus-mt-zh-en-bili-onnx/ | Helsinki-NLP/opus-mt-zh-en | ONNX (q8 dynamic + merged decoder) | 152 MB | Pure CPU (@huggingface/transformers / ONNX Runtime), 0 raw CJK leaks | CC BY 4.0 |
Benchmark (Unseen Bilibili Video BV1byyrz8EL5)
| Variant | Size | Device & Throughput | Raw CJK Leaks | Full Pipeline Leaks (with term repair) | Eval Loss |
|---|---|---|---|---|---|
Qwen/Qwen3-0.6B (Base Q4_K_M) | 462 MB | Vulkan GPU 79.1 ms/item (100 items) | 4 / 100 | — | — |
bili-zh-en-qwen3-0.6b-Q4_K_M.gguf | 379 MB | Vulkan GPU 90.2 ms/item (130 items full pipeline) / CPU 464.0 ms/item | 6 / 100 | 0 / 130 | 1.2329 |
opus-mt-zh-en-bili-onnx/ (q8) | 152 MB | CPU 141.3 ms/item (100 items) | 0 / 100 | — | 2.3620 |
Index-Translate-2B.Q4_K_M (Teacher reference) | 1.3 GB | Vulkan GPU ~142 ms/item (130 items) | — | 0 / 130 | — |
Usage
1. bili-zh-en-qwen3-0.6b-Q4_K_M.gguf (node-llama-cpp / llama.cpp)
Trained in non-thinking mode (enable_thinking=False / empty <think>\n\n</think>\n\n assistant prefix) with compact tags:
- Danmaku:
<|dm|>{chinese_text} - Comments:
<|cm|>{chinese_text} - Isolated term fallback:
Translate to English only: {span}
import { getLlama, LlamaChatSession, QwenChatWrapper } from 'node-llama-cpp';
const llama = await getLlama({ gpu: 'auto' });
const model = await llama.loadModel({ modelPath: './bili-zh-en-qwen3-0.6b-Q4_K_M.gguf' });
const ctx = await model.createContext({ contextSize: 512 });
const session = new LlamaChatSession({
contextSequence: ctx.getSequence(),
chatWrapper: new QwenChatWrapper({ thoughts: 'discourage' }),
});
const out = await session.prompt('<|dm|>前方高能', {
maxTokens: 64,
temperature: 0,
repeatPenalty: { penalty: 1.18, lastTokens: 48 },
});
console.log(out); // "High-energy ahead"
2. opus-mt-zh-en-bili-onnx/ (@huggingface/transformers, CPU)
Download the opus-mt-zh-en-bili-onnx/ folder locally, then point env.localModelPath to its parent directory:
import path from 'node:path';
import { env, pipeline } from '@huggingface/transformers';
env.allowRemoteModels = false;
env.allowLocalModels = true;
env.localModelPath = path.resolve('.');
const translator = await pipeline('translation', 'opus-mt-zh-en-bili-onnx', {
dtype: 'q8',
device: 'cpu',
});
const res = await translator('真香警告', { num_beams: 1, max_new_tokens: 48 });
console.log(res[0].translation_text); // "So good!"
Selected Before vs After Examples (Qwen3-0.6B)
| Source | Untrained Base Qwen3-0.6B | Fine-Tuned bili-zh-en-qwen3-0.6b | Fine-Tuned opus-mt-zh-en-bili |
|---|---|---|---|
前方高能 | "Ahead of the physics!" | "High-energy ahead" | "Top-down high-performance" |
up主牛逼 | "Up主牛逼" | "Awesome, creator!" | "Up top, awesome!" |
感谢UP主 | "Thank you for the video" | "Thanks, creator!" | "Thanks to Lord CP" |
绷不住了 | "I'm sorry, I can't understand..." | "I can't hold it in anymore" | "I can't hold it in anymore" |
爷青回 | "Ryqh back" | "Back to my youth" | "Back from the youth" |
厕纸剧情 | "Shampoo story" | "Toilet paper plot" | "The toilet paper drama" |
Known Limitations
- At
0.6BQ4_K_M, a few culturally idiomatic phrases still fall behind the2Bteacher (泪目了家人们->"LMAO, family!",真香警告->"True Love Warning"). opus-mt-zh-en-bili-onnxruns fast on CPU with zero Chinese leaks, but retains traditional Seq2Seq weaknesses on Bilibili slang and hardware model names (华为pura80pro->"Hua's uraa80pro is here to challenge").
Licenses
bili-zh-en-qwen3-0.6b-Q4_K_M.gguf: Apache 2.0 (fromQwen/Qwen3-0.6Band distillation teacherIndexTeam/Index-Translate-2B-GGUF).opus-mt-zh-en-bili-onnx/: CC BY 4.0 (fromHelsinki-NLP/opus-mt-zh-en).