Views
No views yet
amestris-1b-dpo-sft is the sequential DPO→SFT checkpoint from the Amestris English-to-German machine-translation study. Training begins from google/gemma-3-1b-it, applies the Amestris DPO adaptation, and then performs supervised fine-tuning on the preferred translations from the same hard-27k research setting.| Field | Value |
|---|---|
| Task | English → German machine translation |
| Architecture | Gemma 3 1B instruction-tuned causal language model + LoRA |
| Base model | google/gemma-3-1b-it |
| Training sequence | DPO followed by SFT |
| Starting DPO release | gaokerena/amestris-1b-dpo |
| Final checkpoint type | PEFT LoRA adapter, non-merged |
| LoRA rank / alpha / dropout | 32 / 32 / 0.05 |
| Maximum sequence length | 768 tokens |
| SFT epochs | 1 |
| SFT learning rate | 5 × 10⁻⁵ |
| Random seed | 42 |
| Languages | English input, German output |
pip install -U "transformers>=4.50.0" "peft>=0.18.1" "accelerate>=1.0" torchhf auth login1import torch
2from peft import PeftModel
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5BASE_MODEL_ID = "google/gemma-3-1b-it"
6ADAPTER_ID = "gaokerena/amestris-1b-dpo-sft"
7
8# Use the base-model tokenizer, matching the project evaluation workflow.
9tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_ID)
10
11base_model = AutoModelForCausalLM.from_pretrained(
12 BASE_MODEL_ID,
13 device_map="auto",
14 dtype="auto",
15)
16model = PeftModel.from_pretrained(base_model, ADAPTER_ID)
17model.eval()
18
19source_text = "The committee will publish its final report next Tuesday."
20translation_prompt = f"""You are an expert professional translator from English to German.
21Preserve all meaning, nuance, factual details, names, dates, and numbers.
22Use natural, fluent, professional standard German.
23Do not omit, summarize, add, or explain anything.
24Return only the German translation.
25
26Text to translate:
27{source_text}"""
28
29messages = [{"role": "user", "content": translation_prompt}]
30formatted_prompt = tokenizer.apply_chat_template(
31 messages,
32 tokenize=False,
33 add_generation_prompt=True,
34)
35inputs = tokenizer(formatted_prompt, return_tensors="pt")
36device = next(model.parameters()).device
37inputs = {name: tensor.to(device) for name, tensor in inputs.items()}
38
39with torch.inference_mode():
40 output_ids = model.generate(
41 **inputs,
42 max_new_tokens=256,
43 do_sample=False,
44 num_beams=4,
45 early_stopping=True,
46 repetition_penalty=1.05,
47 no_repeat_ngram_size=3,
48 )
49
50generated_ids = output_ids[0, inputs["input_ids"].shape[1]:]
51translation = tokenizer.decode(generated_ids, skip_special_tokens=True).strip()
52print(translation)adapter_config.json and adapter_model.safetensors through the repository ID shown above.prefered_answer; rejected responses are not included in the supervised loss.prompt → prefered_answer training mapping. LoRA uses rank 32, alpha 32, and dropout 0.05 across the principal linear projections.| Metric | gemma3-1b-it baseline | amestris-1b-dpo-sft | better direction |
|---|---|---|---|
| BLEU | 0.1573 | 0.1718 | ↑ |
| COMET22 | 0.7698 | 0.8119 | ↑ |
| COMET-KIWI22 | 0.7031 | 0.7790 | ↑ |
| METEOR | 0.3861 | 0.4325 | ↑ |
| TER | 0.7765 | 0.7847 | ↓ |
| chrF++ | 41.93 | 45.24 | ↑ |
adapter_model.safetensors and adapter_config.json: final inference adapter.lora_adapter/: copy of the final adapter directory and training metrics.trainer_checkpoints/: trainer checkpoint retained for reproducibility.tokenizer/: additional tokenizer artifact copy.checkpoint_package_metadata.json: provenance and packaging metadata.archives/: archived checkpoint package.1@misc{ghassabi2026backtranslation,
2 title = {Backtranslation Augmented Direct Preference Optimization for Neural Machine Translation},
3 author = {Ghassabi, Mehrdad and Rajabi, Spehr and Baradaran Kashani, Hamidreza and Hakim, Sadra and Keivandarian, Mahshid and Jahani Bahnamiri, Amirhossein},
4 year = {2026},
5 eprint = {2604.25702},
6 archivePrefix = {arXiv},
7 primaryClass = {cs.CL}
8}