Model Card for GaMS3-12B-GRPO-Translator

GaMS3-12B-GRPO-Translator is a fine-tuned version of GaMS3-12B model, specialized for English to Slovene translation. The model was specilaized through 3 training phases (each phase trained a LoRA adapter):

  • SFT on 1000 high-quality English to Slovene translation examples (this stage trained the model to use proper chat template).
  • DPO on approximately 1500 on-policy examples (the DPO was used to fix the errors such as incorrect formating, truncation and failing to stop)
  • GRPO on 100k examples (the main training stage - different reward functions, such as COMET, length score and language score).

image/png

Basic information

  • Developed by: team of researchers at the University of Ljubljana, Faculty for Computer and Information Science. Team members: Domen Vreš, Nikola Sekulovski, Dario Vajda, Iztok Lebar Bajec and Marko Robnik-Šikonja.
  • Languages: Specialized for English to Slovene translation
  • Base model: cjvt/GaM3-12B
  • License: Gemma

Usage

The model can be used as a standard chat/instruct model. It uses the same chat template as cjvt/GaMS3-12B-Instruct

Prompt

We trained the model using the following translation prompt. We suggest the same prompt is used during the inference.

Si profesionalni prevajalec iz angleščine v slovenščino. Tvoja naloga je ustvariti visoko kakovostne prevode, ki so naravni, tekoči in natančni. Izogibaj se dobesednim prevodom, ki zvenijo nenaravno. Upoštevaj kontekst, idiome in kulturne reference. Ne dodajaj nobenih dodatnih informacij ali komentarjev, samo prevod.

Prevedi podano angleško besedilo v slovenščino.

{{ English text }}

Transformers library

The model can be run through pipeline API using the following code:

from transformers import pipeline
model_id = "cjvt/GaMS3-12B-GRPO-Translator"
model = pipeline(
    "text-generation",
    model=model_id,
    device_map="cuda" # replace with "mps" to run on a Mac device
)
# Example of response generation
prompt_template = "Si profesionalni prevajalec iz angleščine v slovenščino. Tvoja naloga je ustvariti visoko kakovostne prevode, ki so naravni, tekoči in natančni. Izogibaj se dobesednim prevodom, ki zvenijo nenaravno. Upoštevaj kontekst, idiome in kulturne reference. Ne dodajaj nobenih dodatnih informacij ali komentarjev, samo prevod.\n\nPrevedi podano angleško besedilo v slovenščino."
english_text = "This is the text to translate."
message = [{"role": "user", "content": f"{prompt_template}\n\n{english_text}"}]
response = model(message, max_new_tokens=512)
print("Transltion:", response[0]["generated_text"][-1]["content"])

vLLM library

The model is supported in vLLM the same way as GaMS3-12B-Instruct (and Gemma 3). Example vLLM code:

from vllm import LLM, SamplingParams
model = LLM("cjvt/GaMS3-12B-GRPO-Translator")
sampling_params = SamplingParams(
    n=1,
    temperature=0.2,
    top_p=0.9,
    max_tokens=1024
)
prompt_template = "Si profesionalni prevajalec iz angleščine v slovenščino. Tvoja naloga je ustvariti visoko kakovostne prevode, ki so naravni, tekoči in natančni. Izogibaj se dobesednim prevodom, ki zvenijo nenaravno. Upoštevaj kontekst, idiome in kulturne reference. Ne dodajaj nobenih dodatnih informacij ali komentarjev, samo prevod.\n\nPrevedi podano angleško besedilo v slovenščino."
english_text = "This is the text to translate."
message = [{"role": "user", "content": f"{prompt_template}\n\n{english_text}"}]
response = model.chat(messages, sampling_params)
print("Translation:", response[0].outputs[0].text)
Downloads last month
12
Safetensors
Model size
12B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for cjvt/GaMS3-12B-GRPO-Translator

Finetuned
cjvt/GaMS3-12B
Finetuned
(2)
this model

Collection including cjvt/GaMS3-12B-GRPO-Translator