Gemma 4 31B EN-NL LoRA
adapter for quality translation into Dutch
2 min readupdated
This LoRA (small add-on built on top of the base model) adapts the powerful google/gemma-4-31B-it language model for precise text translation from English to Dutch. Training relied on selecting the best translation options using the base model itself as a judge, along with quality metric filtering. The adapter covers attention layers and MLP projections across all text decoder layers. The model will be useful for developers and researchers who need high-quality text translation that preserves the original tone and formatting.
Key features
- Specialization in English and Dutch languages
- Trained on 24,000 text sources with selection of the best generated variants
- Uses a LoRA rank of 32 and alpha of 16 for deep tuning
- Support for integration with transformers and peft libraries
What you can do
- Deploy a local translation service from English to Dutch
- Use the adapter with the peft library to generate accurate translatable responses
- Apply the ready-made GGUF version of the model for inference in llama.cpp or LM Studio
Example
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_id = "google/gemma-4-31B-it"
adapter_id = "yhavinga/gemma-4-31b-it-en-nl-lora"
tokenizer = AutoTokenizer.from_pretrained(base_id)
model = AutoModelForCausalLM.from_pretrained(base_id, dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()Read more
DetailsBenchmarks WMT24++, FLORES-200, NTREX-128 (MetricX-24 and COMET-22 showed a small increase in accuracy)
VRAM/hardware requirements: about 62 GB of accelerator or system memory for bf16
Limitations: only translation from English to Dutch was evaluated; the judge model could favor its own style
Training details: 244.9M parameters, AdamW optimizer, step 140 out of 205










Comments