Downloads · 30 days
25
25% of all-time downloads
SatorTenet/gemma-4-E2B-it-serbian-dpo-lora
gemma-4-E2B-it-serbian-dpo-lora is a text generation model from SatorTenet. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
The first published Serbian fine-tune of gemma-4-E2B (and, at the time of publishing, of any gemma-4 model). A 101 MB–268 MB LoRA adapter that makes the 2B edge-class Gemma write measurably better Serbian — both scrip…
Downloads · 30 days
25
25% of all-time downloads
All-time downloads
100
Public
Repo size
382 MB
Likes
0
Public
Click a slice to open those files.
.safetensors248 MB · 65%
From the Hugging Face model README
The first published Serbian fine-tune of gemma-4-E2B (and, at the time of publishing, of any gemma-4 model). A 101 MB–268 MB LoRA adapter that makes the 2B edge-class Gemma write measurably better Serbian — both scripts, clean form, no script mixing — while keeping base knowledge intact (paired McNemar guard on every training step) and partially repairing the overconfidence that instruction tuning itself introduces.
Runs in ~3.8 GB VRAM with full 131k context under llama.cpp.
google/gemma-4-E2B-it · Method: QLoRA SFT (form) → DPO
(confidence calibration) · 62M trainable params (1.55 %)| capability | verdict |
|---|---|
| Clean Serbian prose, both scripts, ekavian | ✅ the main win — 0 script mixing, clean Markdown |
| Answering in the script you ask in | ✅ |
| Refusing false-premise questions | ⚠️ partially — see the measured story below |
| Factual QA without retrieval | ❌ it is a 2B model; use RAG for facts |
Examples (greedy, actual outputs):
Q: Koje godine je Nikola Tesla dobio Nobelovu nagradu za fiziku? A: Nikola Tesla nije dobio Nobelovu nagradu za fiziku. …
Q: U kojoj srpskoj pokrajini se nalazi grad Dubrovnik? A: Grad Dubrovnik se ne nalazi u Srbiji. On se nalazi u Hrvatskoj…
We tracked 20 false-premise trap questions (own SRZ-1 eval, frozen classifier + mandatory manual review) across every method. Confabulation count, lower is better:
| step | traps confabulated (manual) |
|---|---|
| base gemma-4-E2B-it | 10/20 (it often abstained) |
| after SFT (form training) | 20/20 — SFT destroys the base model's caution |
| SFT + 13 % diverse denial examples | ~16–17/20 — imitation learning cannot restore it |
| + DPO, 268 pairs | 14/20 |
| + DPO, 465 pairs, 3 epochs (this adapter) | 12/20 |
Three findings we believe transfer beyond this project:
Knowledge guard: paired McNemar on MC accuracy after every step — final Δ latin −0.012 (p=0.42), cyrillic −0.004 (p=0.23) vs. the SFT checkpoint.
llama-server -m gemma-4-E2B-it-Q6_K.gguf \
--lora gguf/lima_dpo_adapter_v2_f16.gguf \
-ngl 99 -c 131072 --jinja --reasoning off
--reasoning off is required. Without it the gemma-4 chat template puts
the model in thinking mode and message.content comes back empty (everything
lands in reasoning_content). Alternatively pass
"chat_template_kwargs": {"enable_thinking": false} per request.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("google/gemma-4-E2B-it",
device_map="auto", load_in_4bit=True)
model = PeftModel.from_pretrained(base, "SatorTenet/gemma-4-E2B-it-serbian-dpo-lora")
tok = AutoTokenizer.from_pretrained("SatorTenet/gemma-4-E2B-it-serbian-dpo-lora")
msgs = [{"role": "user", "content": "Napiši mi tri rečenice o Beogradu."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
print(tok.decode(model.generate(ids.to(model.device), max_new_tokens=200)[0]))
| file | size | purpose |
|---|---|---|
adapter_model.safetensors + adapter_config.json | 248 MB | PEFT LoRA adapter |
gguf/lima_dpo_adapter_v2_f16.gguf | 101 MB | GGUF LoRA for llama.cpp --lora |
tokenizer.json, tokenizer_config.json, chat_template.jinja | 32 MB | tokenizer (unchanged from base) |