Downloads · 30 days
4
8% of all-time downloads
Hodfa71/gpt-sw3-1b3-icelandic-delta-dpo
gpt-sw3-1b3-icelandic-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 other.
This is a LoRA adapter for GPT-SW3 1.3B trained to generate grammatically correct Icelandic text.
Downloads · 30 days
4
8% of all-time downloads
All-time downloads
51
Public
Repo size
51.4 MB
Likes
0
Public
Click a slice to open those files.
.safetensors50.4 MB · 98%
From the Hugging Face model README
This is a LoRA adapter for GPT-SW3 1.3B trained to generate grammatically correct Icelandic text.
The adapter was trained using SAGA (Syntax-Aware Generation Alignment), applying Delta-DPO directly on the 1.3B base model. The model generates 8 candidate continuations per prompt, filters pairs by quality gap, and optimizes preference with DPO. No SFT warm-up was used since Delta-DPO from the 1.3B base already achieves strong results.
This model achieves the highest absolute parse score of all models we evaluated.
Evaluated on 200 Icelandic Wikipedia sentences:
| Metric | Base 1.3B | This model |
|---|---|---|
| Greynir parse success | 85.5% | 96.0% |
| Parse score | 0.593 | 0.763 |
| PPL-Wiki | 19.4 | 24.4 |
Parse score = parse success rate times mean parse quality.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("AI-Sweden-Models/gpt-sw3-1.3b", torch_dtype="auto")
model = PeftModel.from_pretrained(base, "Hodfa71/gpt-sw3-1b3-icelandic-delta-dpo")
tokenizer = AutoTokenizer.from_pretrained("AI-Sweden-Models/gpt-sw3-1.3b")
prompt = "Íslenska er"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=50, temperature=0.8, do_sample=True)
print(tokenizer.decode(output[0], skip_special_tokens=True))
The training data is Icelandic Wikipedia (10,000 sentences, filtered for quality).
Delta-DPO generates 8 candidate continuations per prompt (4 at temperature 0.7, 4 at temperature 1.1). Pairs where the quality gap is above 0.25 and the chosen score is above 0.20 are kept for training. DPO runs for 2 epochs with beta=0.1, LoRA r=16.
The grammar reward uses Greynir, an Icelandic NLP library that checks whether a sentence has a valid constituency parse with a verbal root and a nominal subject.
Paper is under review. Will update with citation when available.
The base model (GPT-SW3) is released by AI Sweden under their LLM license. This fine-tuned version inherits the same license. Attribution: AI Sweden, RISE, and WASP.