Gemma3 の翻訳特化モデル「TranslateGemma」をOllamaで動かす

作成日 2026年1月20日火曜日

更新日 2026年1月20日火曜日

Google の Gemma3 の翻訳特化モデルである TranslateGemma を Ollama で動かすためのメモ

日本語も含む55言語に対応している

Ollama

詳細(サポートされている言語など): https://ollama.com/library/translategemma

% ollama pull translategemma

pulling manifest 
pulling bdbf939b402e: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 3.3 GB                         
pulling e0a42594d802: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏  358 B                         
pulling 3e2c24001f9e: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 8.4 KB                         
pulling 339e884a40f6: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏   61 B                         
pulling 37490ee3c3a4: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏  489 B                         
verifying sha256 digest 
writing manifest 
success 

モデルには 4b, 12b, 27b があり、デフォルトは 4b

TranslateGemma の 12b モデルが Gemma3 の 27b モデルの翻訳性能を上回る

Prompt Format

プロンプトの構造が決まっている

{TEXT} の前に2行の空行があることに注意

You are a professional {SOURCE_LANG} ({SOURCE_CODE}) to {TARGET_LANG} ({TARGET_CODE}) translator. Your goal is to accurately convey the meaning and nuances of the original {SOURCE_LANG} text while adhering to {TARGET_LANG} grammar, vocabulary, and cultural sensitivities.
Produce only the {TARGET_LANG} translation, without any additional explanations or commentary. Please translate the following {SOURCE_LANG} text into {TARGET_LANG}:


{TEXT}

Examples

English to Japanese

プロンプト

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


Hello, World!

実行例

% ollama run translategemma

>>> You are a professional English (en) to Japanese (ja) translator. Your goal is to accurately convey the meaning and nuances of the original English text while adhering to Japanese grammar, vocabulary, and
...  cultural sensitivities.
... Produce only the Japanese translation, without any additional explanations or commentary. Please translate the following English text into Japanese:
... 
... 
... Hello, World!
こんにちは、世界!

Japanese to English

プロンプト

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


こんにちは、世界!