gemma-4-e4b-translate-ml

Multilingual translation model built on Gemma 4 E4B. It covers Japanese, English, Chinese (Simplified and Traditional), Korean, French, German, Spanish, Portuguese, Italian and Russian: English ⇄ each language plus Japanese ⇄ Chinese and Japanese ⇄ Korean (24 directions trained).

Based on TranslateGemma. The training recipe, the prompt format and the evaluation protocol follow Google's TranslateGemma (TranslateGemma Technical Report, arXiv:2601.09012; released models such as google/translategemma-4b-it), re-implemented independently on Gemma 4. This is not an official TranslateGemma model.

Gemma 4 E4B をベースに、Google の TranslateGemma(技術報告 arXiv:2601.09012)の 手順・プロンプト形式・評価方法を参考にして、11言語(24方向)向けに独自に学習した翻訳モデルです(TranslateGemma の公式版ではありません)。

Prompt / プロンプト

Use the TranslateGemma prompt as the user message (thinking disabled), with the language names and codes of the pair, e.g. English (en-US) to Traditional Chinese (zh-TW), Japanese (ja-JP) to Korean (ko-KR).

You are a professional English (en-US) to Traditional Chinese (zh-TW) translator. Your goal is to accurately convey the meaning and nuances of the original English text while adhering to Traditional Chinese grammar, vocabulary, and cultural sensitivities. Produce only the Traditional Chinese translation, without any additional explanations or commentary. Please translate the following English text into Traditional Chinese:


{text}
import torch
from transformers import AutoModelForCausalLM, AutoProcessor

model_id = "wahokun/gemma-4-e4b-translate-ml"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")

prompt = '''You are a professional English (en-US) to Traditional Chinese (zh-TW) translator. Your goal is to accurately convey the meaning and nuances of the original English text while adhering to Traditional Chinese grammar, vocabulary, and cultural sensitivities. Produce only the Traditional Chinese translation, without any additional explanations or commentary. Please translate the following English text into Traditional Chinese:


Please review the attached document by Friday.'''
text = processor.apply_chat_template([{"role": "user", "content": prompt}], tokenize=False,
                                     add_generation_prompt=True, enable_thinking=False)
inputs = processor(text=text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Evaluation / 評価

Greedy decoding. Each cell is COMET-22 ↑ / MetricX-24 ↓, averaged over the directions of the group (X→Y = Japanese ⇄ Chinese / Korean). FLORES+ devtest sentences were not used for training or teacher selection.

Test set Directions Gemma 4 E4B (base) this model ja⇄en-only SFT (phase 1) TranslateGemma 4B
FLORES+ devtest en→X (10) 0.8952 / 1.925 0.8978 / 1.800 0.8967 / 1.808 0.8904 / 1.937
FLORES+ devtest X→en (10) 0.8836 / 2.108 0.8836 / 2.059 0.8826 / 2.062 0.8760 / 2.113
FLORES+ devtest X→Y (4) 0.8956 / 2.906 0.8953 / 2.872 0.8960 / 2.808 0.8895 / 3.063
WMT24++ en→X (10) 0.8424 / 3.290 0.8488 / 3.069 0.8473 / 3.050 0.8386 / 3.107

Against the base model, paired bootstrap (95% CI) shows significant COMET-22 gains on most English→X directions; X→English and Japanese ⇄ Chinese/Korean are on par with the base model in COMET-22.

Training / 学習

  • Teachers (chosen per direction on FLORES+ dev): Gemma 4 31B, DeepSeek V4.1 Flash, Qwen3.5-27B
  • Per source: top-1 teacher greedy + sample, top-2 teacher greedy; the candidate with the best mean rank of MetricX-24 QE and COMET-22 MBR consensus was kept (plus language, script and length checks)
  • Sources: MADLAD-400 (clean), 5,000 per direction; ja⇄en data from the phase-1 model; evaluation sets removed
  • SFT data: 107,118 translation pairs + 18,108 general chat examples; general prompts from UltraChat, databricks-dolly-15k-ja and the Aya dataset, answered by Gemma 4 E4B
  • LoRA r=32, alpha=32, text decoder attention/MLP only; embeddings and vision/audio towers frozen; loss on the reply only; 1 epoch

Limitations / 制限

  • Directions outside the 24 trained ones fall back to the base model's ability.
  • MetricX-24 improves more than COMET-22 on some directions; part of that is a bias from MetricX-based data selection.

License / ライセンス

The model weights are released under Apache 2.0, the license of the Gemma 4 base model. Data used for training (please also respect the terms of these sources):

Source Use License / terms
Gemma 4 E4B (google/gemma-4-E4B-it) base model Apache 2.0
MADLAD-400 (clean) source sentences ODC-BY 1.0
Gemma 4 31B, Qwen3.5-27B teacher translations Apache 2.0
DeepSeek V4.1 Flash (served by DeepSeek) teacher translations DeepSeek Open Platform terms (outputs may be used for model training)
UltraChat 200k general-chat prompts MIT
databricks-dolly-15k-ja general-chat prompts (Japanese) CC BY-SA 3.0
Aya dataset general-chat prompts (multilingual) Apache 2.0
FLORES+, WMT24++ evaluation only (removed from training sources) CC BY-SA 4.0 / Apache 2.0

This is an independent community model. It is not affiliated with or endorsed by Google, and it is not an official TranslateGemma release; "translategemma-recipe" refers to the published training method.

本モデルは個人による非公式のモデルで、Google とは関係ありません(TranslateGemma の公式版ではありません)。

Acknowledgements / 参考

  • TranslateGemma Technical Report — https://arxiv.org/abs/2601.09012 (training recipe, prompt template, evaluation setup)
  • Gemma 4 — base model
  • MetricX-24 and COMET-22 — evaluation and data selection
Downloads last month
10
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for hmkz-1981/gemma-4-e4b-translate-ml

Finetuned
(461)
this model

Paper for hmkz-1981/gemma-4-e4b-translate-ml