CoolFace
Modelpublic

17slever17/translate-gemma-4-sub-e2b

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
1likes37downloads
Model Card

<p align="center"> <img src="https://huggingface.co/17slever17/translate-gemma-4-sub-e2b/resolve/main/assets/translate-gemma-sub-banner.png" alt="Translate Gemma 4 Sub" width="100%"> </p>

Translate Gemma 4 Sub

Translate Gemma 4 Sub is a multilingual Gemma 4 fine-tune specialized for both general translation and context-aware subtitle translation.

👉🏻 The models are used by **SubWave**, an open-source realtime subtitle translator. 👈🏻

The model supports ordinary source-to-target translation as well as subtitle translation with previous source and translated segments provided as context. It is optimized to preserve meaning, tone, slang, uncertainty, repetitions, incomplete speech, and natural/official conversational style.

Why not use google/translategemma-4b-it?

Subtitle translation often requires previous context because phrases may be split across segments or lose their meaning when translated in isolation. Translate Gemma 4 Sub can use previous source and translated subtitles as context, while also supporting custom style instructions, speaker information, terminology rules, glossaries, and other translation constraints.

Other instruction-following translation models, such as tencent/Hy-MT2-7B, performed even worse than the base Gemma 4 model in our evaluation.

Available formats

E4B:

E2B:

Intended use

The model is especially optimized for live and conversational speech, including streaming content, where meaning often depends on previous lines, speaker intent, tone, and incomplete context. It performs particularly well when previous source and translated segments are supplied and can follow additional user instructions that define the desired style, tone, or level of formality.

Translate Gemma 4 Sub retains the language coverage of the underlying Gemma 4 model. The most extensively trained languages are:

  • Tier 1: English, Russian, Spanish, German and Japanese;
  • Tier 2: French, Portuguese, Chinese, Dutch, Italian, and Korean.

Other languages supported by Gemma 4 may also work, but they have not undergone specific translation fine-tuning and have not been evaluated as extensively.

Benchmark results

All models in the following table were evaluated in GGUF Q4 format under the same generation and evaluation pipeline.

Higher is better for chrF++, BERTScore, COMET-DA, and COMETKiwi. Lower is better for MetricX Ref and MetricX QE.

ModelchrF++ ↑BERTScore ↑COMET-DA ↑COMETKiwi ↑MetricX-24 Ref ↓MetricX-24 QE ↓
Translate Gemma 4 Sub E4B Q4_K_XL51.82180.8675940.8353930.7453912.70742.8150
Translate Gemma 4 Sub E2B Q4KXL49.10030.8571300.8228670.7415673.10023.0091
Gemma 4 12B QAT Q4KXL51.55960.8559060.8289040.7581242.88132.7447
Gemma 4 E4B Q4KXL48.48460.8488220.8111010.7521023.23903.0889
Gemma 4 E2B Q4KXL45.01720.8362040.7821350.7320843.86523.3755

The evaluation set was independent from the training data. Its reference translations were prepared from randomly selected stream segments that were not used during training.

MetricX-24 Ref by target language

Scores are grouped by target language. Lower is better.

ModelRussian ↓English ↓Japanese ↓Spanish ↓German ↓
Translate Gemma 4 Sub E4B Q4_K_XL2.9972.5122.8092.8052.217
Translate Gemma 4 Sub E2B Q4KXL3.1002.5733.1382.9012.370
Gemma 4 12B QAT Q4KXL3.2522.6192.7372.9212.165
Gemma 4 E4B Q4KXL3.4772.6873.1723.3102.694
Gemma 4 E2B Q4KXL4.1083.2703.5223.6462.948

Prompt format

The model was trained with a system message that specifies the source language, target language, subtitle task, and style.

System message

text
TASK: Translate {source_language} subtitles into {target_language}.
RULES: Speakers name: ...; speaker gender: ...; other rules.
STYLE: friendly/official/neutral.
Translate only CURRENT_SOURCE. PREVIOUS_SOURCE and PREVIOUS_TRANSLATION are context only. Preserve meaning, tone, slang, profanity, uncertainty, repetitions and incomplete speech. Return only the final translation without labels or commentary.

User message

text
[PREVIOUS_SOURCE]
Previous source-language subtitles context.

[PREVIOUS_TRANSLATION]
Previous translated subtitles context.

[CURRENT_SOURCE]
The subtitle segment to translate.

Only CURRENT_SOURCE should be translated. PREVIOUS_SOURCE and PREVIOUS_TRANSLATION are context only.

The previous-context blocks may be omitted when no context is available:

text
[CURRENT_SOURCE]
The subtitle segment to translate.

Example

System message:

text
TASK: Translate English subtitles into Russian.
RULES: speaker gender: female.
STYLE: friendly.
Translate only CURRENT_SOURCE. PREVIOUS_SOURCE and PREVIOUS_TRANSLATION are context only. Preserve meaning, tone, slang, profanity, uncertainty, repetitions and incomplete speech. Return only the final translation without labels or commentary.

User message:

text
[PREVIOUS_SOURCE]
I thought you said you weren't coming.

[PREVIOUS_TRANSLATION]
Я думала, ты сказала, что не придёшь.

[CURRENT_SOURCE]
Yeah, well... I changed my mind.

Expected response:

text
Ну да... Я передумала.

FLORES-200 general translation benchmark

Evaluation was performed on FLORES-200 using MetricX-24 QE. Lower is better.

ModelMean error ↓Median ↓P90 ↓
Gemma 4 12B QAT1.88111.53913.5938
Translate Gemma 4 Sub E4B2.06581.65234.0312
Gemma 4 E4B2.07691.68754.1562
Translate Gemma 4 Sub E2B2.22471.79304.4062
Gemma 4 E2B2.27741.83594.4062

Despite being primarily optimized for contextual and conversational translation, Translate Gemma 4 Sub also slightly improved general translation quality over the corresponding base Gemma 4 models.

The following prompt was used for general translation:

text
TASK: Translate {source_language} into {target_language}.
Follow all demonstrations, glossary mappings, partial-translation constraints and formatting instructions in the user prompt.
Preserve meaning, names, numbers, terminology, register and document structure. Return only the requested final translation without commentary.

Usage with Transformers

python
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

model_id = "17slever17/translate-gemma-4-sub-e2b"

tokenizer = AutoTokenizer.from_pretrained(model_id)

model = AutoModelForImageTextToText.from_pretrained(
    model_id,
    torch_dtype="auto",
    device_map="auto",
)

messages = [
    {
        "role": "system",
        "content": """TASK: Translate English subtitles into Russian.
STYLE: friendly.
Translate only CURRENT_SOURCE. PREVIOUS_SOURCE and PREVIOUS_TRANSLATION are context only. Preserve meaning, tone, slang, profanity, uncertainty, repetitions and incomplete speech. Return only the final translation without labels or commentary.""",
    },
    {
        "role": "user",
        "content": """[PREVIOUS_SOURCE]
I thought you said you weren't coming.

[PREVIOUS_TRANSLATION]
Я думала, ты сказала, что не придёшь.

[CURRENT_SOURCE]
Yeah, well... I changed my mind.""",
    },
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt",
    return_dict=True,
).to(model.device)

with torch.inference_mode():
    output = model.generate(
        **inputs,
        max_new_tokens=256,
        do_sample=False,
    )

generated_tokens = output[0, inputs["input_ids"].shape[1]:]
translation = tokenizer.decode(generated_tokens, skip_special_tokens=True)

print(translation)

Training overview

Translate Gemma 4 Sub E2B is based on google/gemma-4-E2B-it.

Training was performed with Unsloth using an optimized training run derived from the official Gemma 4 model.

Citation

bibtex
@misc{17slever17_translate_gemma_4_sub_2026,
  author       = {17slever17},
  title        = {Translate Gemma 4 Sub E2B},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/17slever17/translate-gemma-4-sub-e2b}}
}