Downloads · 30 days
9
9% of all-time downloads
Thermostatic/rosettia-quy-gspo-nllb13b-lora
rosettia-quy-gspo-nllb13b-lora is a translation model from Thermostatic. Use it when you need text moved from one language to another. It is set up for peft. The card lists the license as cc-by-nc-4.0.
Downloads · 30 days
9
9% of all-time downloads
All-time downloads
96
Public
Repo size
4.6 GB
Likes
0
Public
Click a slice to open those files.
.safetensors3 GB · 98%
From the Hugging Face model README
YouTube entry: Rosettia video
A LoRA adapter for facebook/nllb-200-1.3B for Spanish → Chanka / Ayacucho
Quechua (quy_Latn), trained with GSPO reinforcement learning (Group Sequence
Policy Optimization) on top of a synthetic-augmented supervised model.
To our knowledge this is the first application of GSPO to an encoder–decoder NMT model. It is the strongest result we are aware of on the AmericasNLP 2021 spa→quy benchmark — but please read the Limitations section: this is a research-grade system, evaluated on a single benchmark with single-reference ChrF and no native-speaker evaluation.

ChrF (sacrebleu, word_order=0), 1003 sentences, single reference. The test set was
never used for training, tuning, or checkpoint selection.
| System | ChrF (w0) |
|---|---|
| Sheffield 2023 (NLLB-3.3B, 3-model ensemble) | 34.01 |
| Helsinki 2021 (prior task winner) | 39.40 |
| Qwen-9B (ours), greedy | 40.55 |
| NLLB-1.3B (ours), supervised + synthetic | 42.95 |
| Qwen-9B ⊕ NLLB-1.3B ensemble (ours) | 45.01 |
| + GSPO RL, single model, beam5 | 45.53 |
| + MBR decoding, single model | 46.43 |
| GSPO multi-checkpoint MBR ensemble (best) | 46.71 |
GSPO adds +2.6 ChrF over the supervised model, and the best single 1.3B model (46.43) matches our previous, much larger 9B + 1.3B ensemble — a simpler, smaller system at equal quality.
Which number is the "clean" one (please read). The fully pre-registered result is the validation-selected checkpoint (ckpt-600) with our standard decode (beam5 + apostrophe-suppression): 45.53 ChrF, a single test evaluation. The MBR (46.43) and multi-checkpoint-ensemble (46.71) numbers involve decode-time choices — the MBR sampling temperature and which checkpoints to ensemble — that we compared on the test set. They are therefore best-found configurations, not blind single evaluations, and the ~0.3–0.6 ChrF spread among them is within the noise of a 1003-sentence single-reference test. The robust, conservative claim is ≈46 ChrF, clearly above prior published work; the exact decimal of the MBR/ensemble rows is configuration-dependent. (The GSPO checkpoint was selected on a held-out validation split, never on test.)
A note on comparability. Many shared-task papers report ChrF++ (
word_order=2), which typically reads ~2–3 points higher than theword_order=0ChrF used here (e.g. BSC-2024, the 2024 task winner, reported 38.21 ChrF++). Cross-metric comparisons should be made with care; all of our numbers above areword_order=0.

Reward = sentence-ChrF against held-out, unseen Ayacucho references (deduplicated against the model's exact training corpus). Validation ChrF climbs, peaks, then declines (over-optimization); we select the peak checkpoint on validation and run a single test evaluation. The test set is never used for selection.
ChrF is a single-reference surface metric and saturates. To check the RL gains are real quality (not metric-gaming), we score several automatic, speaker-free axes:

| Axis | NLLB-1.3B (pre-RL) | + GSPO | direction |
|---|---|---|---|
| ChrF (w0) | 43.17 | 45.53 | higher better |
| Adequacy (round-trip quy→spa vs source) | 48.28 | 52.86 | higher better |
| Spanish-leakage (% sentences) | 3.39 | 2.69 | lower better |
| Length miscalibration (mean |len ratio−1|) | 0.201 | 0.175 | lower better |
GSPO improved adequacy (+4.6) by more than it improved ChrF (+2.4), and reduced leakage and length error — i.e. the gains are multi-axis quality, not surface gaming. (These are automatic proxies; no human judgments exist for this language pair.)
In the scorecard and the metrics table below, NLLB-1.3B is decoded with the same settings as the GSPO model (beam5 +
no_repeat_ngram_size=3+ apostrophe-suppression) → 43.17, vs 42.95 (beam5 only) in the headline table. The matched-decode comparison is the fair one and slightly understates the GSPO gain.

| Metric | NLLB-1.3B (pre-RL) | + GSPO | direction |
|---|---|---|---|
| ChrF (w0) | 43.17 | 45.53 | higher better |
| ChrF++ (w2) | 37.63 | 39.64 | higher better |
| BLEU | 5.65 | 5.94 | higher better |
| TER | 87.02 | 88.62 | lower better |
We report all four for transparency. GSPO (reward = ChrF) improves the character-level metrics (ChrF, ChrF++) and BLEU marginally, but word-level TER does not improve — the RL optimized character overlap, not word edits. BLEU is near-floor for both systems: word n-gram matching is unreliable for an agglutinative language under a single reference, which is exactly why we treat ChrF as the primary metric here.
All scripts are in the GitHub repo; the full
narrative (problems, breakthroughs, methodology) is in docs/report/
(Typst source + compiled PDF). Outline:
# 1. Supervised NLLB (BSC recipe) + synthetic distillation -> "NLLB-r2"
python scripts/nllb/train_nllb_chanka.py --train-parquet clean_chanka/nllb_v2_corpus.parquet ...
# 2. GSPO RL (needs our NLLB-in-vLLM fork; reward = held-out-ref ChrF, G=16)
python scripts/rl/gspo_nllb_vllm.py --init-adapter <nllb-r2> --reward-type chrf --group-size 16 ...
# 3. Select the peak checkpoint on the held-out validation split, then ONE test eval
python scripts/nllb/eval_nllb_americasnlp.py --adapter <ckpt> --no-repeat-ngram 3 # standalone 45.53
# 4. (optional, configuration-dependent) MBR + multi-checkpoint ensemble
python scripts/decoding/gen_candidates_nllb.py --adapter <ckpt> --temperature 0.7
python scripts/decoding/ensemble_mbr_rerank.py --candidate-jsonls <ckpt600> <ckpt800> # 46.71
# audits / scorecard
python scripts/decoding/quality_scorecard.py --reverse-adapter <reverse> --pred-jsonl ...
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
from peft import PeftModel
tok = AutoTokenizer.from_pretrained("facebook/nllb-200-1.3B", src_lang="spa_Latn", tgt_lang="quy_Latn")
m = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-1.3B", torch_dtype=torch.bfloat16)
m = PeftModel.from_pretrained(m, "Thermostatic/rosettia-quy-gspo-nllb13b-lora").cuda().eval()
bos = tok.convert_tokens_to_ids("quy_Latn")
enc = tok("No sé por qué sucedió eso.", return_tensors="pt").to("cuda")
out = m.generate(**enc, forced_bos_token_id=bos, num_beams=5, max_new_tokens=128)
print(tok.batch_decode(out, skip_special_tokens=True)[0]) # -> Manam yachanichu imarayku chay pasarqa.
The root adapter is the validation-selected single model (standalone 45.53 / self-MBR
46.43). For the best result (46.71), sample candidates from this adapter and the
checkpoint-800/ adapter, deduplicate, and pick the ChrF-MBR consensus. Apostrophe
suppression at decode is a small free gain (Ayacucho quy has no glottalization).
no_repeat_ngram_size=3 at decode).quy). Not validated for Cuzco (quz) or Central varieties.cc-by-nc-4.0; non-commercial, consistent with the underlying data sources.A two-person SomosNLP hackathon project:
The project was a close collaboration; both contributions were essential to the result.