Views
No views yet
| Model | Parse Success | Parse Score | PPL |
|---|---|---|---|
| Llama-3.2-1B base | 83.0% | 0.392 | 30.1 |
| + SAGA Δ-DPO (this model) | 98.5% | 0.622 | 33.0 |
| Target | Parse Success |
|---|---|
| Danish | 98.5% |
| Swedish | 99.0% |
| Icelandic | 91.5% |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3import torch
4
5base = AutoModelForCausalLM.from_pretrained(
6 "meta-llama/Llama-3.2-1B",
7 dtype=torch.bfloat16,
8 device_map="auto",
9)
10model = PeftModel.from_pretrained(base, "Hodfa71/llama-3.2-1b-nb-saga-delta-dpo")
11tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")
12
13inputs = tokenizer("Regjeringen kunngjorde i dag", return_tensors="pt").to(model.device)
14out = model.generate(**inputs, max_new_tokens=80, do_sample=True, temperature=0.8)
15print(tokenizer.decode(out[0], skip_special_tokens=True))nb_core_news_lgrepetition_penalty=1.3, mattr_window=201@article{fakhar2025saga,
2 title = {SAGA: Syntax-Aligned Grammar Adaptation via Reinforcement Learning from Verifiable Feedback},
3 author = {Fakhar, Hoda and Carlsson Wiman, Emil},
4 year = {2025}
5}