Downloads · 30 days
8
21% of all-time downloads
Hodfa71/llama-3.2-1b-is-saga-kl-sft-delta-dpo
llama-3.2-1b-is-saga-kl-sft-delta-dpo is a text generation model from Hodfa71. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama3.2.
Fine-tuned with SAGA (Syntax-Aware Grammar Alignment) using KL-regularised SFT followed by Δ-DPO with an MATTR (Moving-Average Type-Token Ratio) diversity penalty to prevent reward hacking.
Downloads · 30 days
8
21% of all-time downloads
All-time downloads
38
Public
Repo size
62.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors45.1 MB · 72%
From the Hugging Face model README
Fine-tuned with SAGA (Syntax-Aware Grammar Alignment) using KL-regularised SFT followed by Δ-DPO with an MATTR (Moving-Average Type-Token Ratio) diversity penalty to prevent reward hacking.
This is a LoRA adapter. Load it on top of meta-llama/Llama-3.2-1B.
Note: Without the MATTR diversity penalty, Llama-3.2-1B exhibits reward hacking — it learns to generate repetitive simple clauses that fool the Greynir parser (Greynir PS 95.5%) but degrade Stanza PS below base (68.5% vs 75.5%). This model uses MATTR + repetition_penalty to prevent that behaviour.
| Metric | Base | Hacked (no MATTR) | This model |
|---|---|---|---|
| Greynir PS ↑ | 63.5% | 95.5% | 89.0% |
| Stanza PS ↑ | 75.5% | 68.5% ↓ | 74.0% |
| MATTR ↑ | 0.612 | 0.491 ↓ | 0.639 |
| ScaLA MCC ↑ | 0.055 | 0.086 | 0.084 |
| PPL-Wiki ↓ | 47.6 | 34.8 | 35.1 |
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B", torch_dtype="auto")
model = PeftModel.from_pretrained(base, "Hodfa71/llama-3.2-1b-is-saga-kl-sft-delta-dpo")
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")
prompt = "Íslenska er"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=60, temperature=0.8, do_sample=True)
print(tokenizer.decode(output[0], skip_special_tokens=True))
@article{fakhar2025saga,
title={SAGA: Syntax-Aware Grammar Alignment for Low-Resource Nordic Languages},
author={Fakhar, Hoda and others},
year={2025},
note={Under review}
}
Meta Llama 3.2 Community License. The LoRA adapter weights are released under the same license as the base model.