Downloads · 30 days
39
7% of all-time downloads
telecomadm1145/NanoSakura-2.2-0.2B
NanoSakura-2.2-0.2B is a translation model from telecomadm1145. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
39
7% of all-time downloads
All-time downloads
536
Public
Parameters
188M
752 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors752 MB · 99%
From the Hugging Face model README
▶️ Live Demo Space — try it in your browser, no setup required.
</div>NanoSakura-2.2-0.2B is a highly efficient, custom-built Hybrid Sequence-to-Sequence (Seq2Seq) model for Japanese → Chinese translation. It pairs the deep contextual understanding of a Transformer Encoder with the fast, memory-efficient generation of a Mamba2 (State Space Model) Decoder.
With only ~188M parameters, it reaches translation quality competitive with — and on in-domain ACG text, well beyond — general-purpose LLMs nearly 10× its size, while keeping a hardware footprint small enough for edge deployment or high-throughput API serving.
💡 Which checkpoint should I use? This is the recommended, best-balanced checkpoint in the NanoSakura-2.x line. A later checkpoint (2.3) trades in-domain (ACG) quality for a small bump on general-domain benchmarks — see Evaluation for details.
shard_00134 results below).Traditional Seq2Seq models (like T5 or BART) rely entirely on Transformers. While powerful, the self-attention mechanism in the decoder leads to an $O(N^2)$ computational bottleneck and high KV-cache memory usage during text generation.
This model solves that with a Hybrid Architecture:
| Developed by | telecomadm1145 |
| Model type | Hybrid Transformer–Mamba2 Seq2Seq |
| Language(s) | Japanese (ja) → Chinese (zh) |
| License | MIT |
| Parameters | ~188M |
| Base model | NanoSakura-2-0.2B |
The fastest way to try the model is the hosted Space — no installation needed:
<div align="center">Because this model uses a custom architecture, you must use trust_remote_code=True when loading it with the transformers library. The custom modeling_mamba2_s2s.py handles the $O(1)$ Mamba2 cache generation automatically.
ℹ️ Note: This model expects the source text to be manually terminated with an explicit
<eos>token before encoding, as shown below.
import torch
from transformers import AutoModelForSeq2SeqLM, PreTrainedTokenizerFast
repo_id = "telecomadm1145/NanoSakura-2.2-0.2B"
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = PreTrainedTokenizerFast.from_pretrained(repo_id)
model = AutoModelForSeq2SeqLM.from_pretrained(
repo_id,
trust_remote_code=True,
torch_dtype=torch.float32,
)
model.to(device)
text = "おはようございます、今日の天気はいいですね!"
input_ids = tokenizer.encode(text + "<eos>")
input_tensor = torch.tensor([input_ids]).to(device)
output_ids = model.generate(
input_tensor,
max_new_tokens=256,
)
result = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(f"Translation: {result}")
# Output: 早安,今天的天气真好呢!
We evaluated on the FLORES-200 benchmark (ja-zh) for general-domain quality, and on an in-domain ACG testset (shard_00134) for domain-specific quality. We report both lexical-overlap (SacreBLEU) and semantic-similarity (COMET) metrics. All results use greedy decoding.
⚠️ Metric details — please read before comparing:
- BLEU: All BLEU scores are computed with SacreBLEU using
tokenize=zh(character-level tokenization), not spBLEU. Scores are internally consistent across every model and dataset in this table (all baselines were re-run under the same setup), but are not directly comparable to spBLEU numbers reported elsewhere (e.g., on the FLORES-200 leaderboard). Underzhtokenization, BLEU values are systematically higher than spBLEU.- COMET: computed with
Unbabel/wmt22-comet-da.
| Metric | opus-mt-ja-zh (~73M) | NanoSakura-2-0.2B | NanoSakura-2.2-0.2B | NanoSakura-2.3-0.2B | NanoSakura-0.3B | nllb-200-1.3B | Qwen3-0.6B | Qwen3-0.6B (thinking) | Qwen3-1.7B | Qwen3-1.7B (thinking) |
|---|---|---|---|---|---|---|---|---|---|---|
| FLORES-200 BLEU | 25.67 | 23.27 | 26.55 | 28.67 | 22.36 | 20.87 | 12.58 | 21.13 | 27.12 | 27.56 |
| FLORES-200 COMET | 0.8371 | 0.8380 | 0.8494 | 0.8563 | 0.8307 | 0.7805 | 0.8020 | 0.8220 | 0.8561 | 0.8571 |
| shard_00134 BLEU | 8.07 | 58.13 | 57.55 | 49.32 | 58.71 | 5.73 | 6.89 | 14.57 | 23.37 | 24.60 |
| shard_00134 COMET | 0.4493 | 0.8615 | 0.8608 | 0.8558 | 0.8654 | 0.5181 | 0.6930 | 0.7414 | 0.8158 | 0.8182 |
Reading the table:
shard_00134), NanoSakura-2.2 (0.8608 COMET) massively outperforms even Qwen3-1.7B-thinking (0.8182 COMET) — a model ~8.5× larger — despite the latter's extra chain-of-thought overhead. (The high absolute BLEU here reflects the combination of the zh tokenizer and the model's strong in-domain fit; compare across columns, not against external spBLEU numbers.)Released under the MIT License.