8 1 month ago

7b
ollama run guinogueira/ffxiv-pt-hy-mt2:7b

Models

View all →

Readme

ffxiv-pt-hy-mt2 — FFXIV EN→pt-BR translation that preserves proper nouns

A fine-tuned build of tencent/Hy-MT2-7B (Hunyuan-Dense, 7B) for English → Brazilian Portuguese translation that keeps FFXIV proper nouns (zones, dungeons, NPCs, jobs, items, mounts, quests, factions, expansions, …) in English, learned directly in the weights — no system prompt, no glossary, no runtime lookup.

FFXIV has no official Brazilian Portuguese localization. Generic MT models translate proper nouns literally (Warrior of LightGuerreiro da Luz, The TempestA Tempestade), which breaks lookup/search/tooling since the whole community uses the English names. This model bakes the “keep these terms in English” behaviour into the weights via QLoRA fine-tuning.

Tags

Tag Quant Size VRAM peak Preservation chrF++
:7b Q8_0 7.5 GB ~10 GB 79.9% (84.6% adj) 86.0
:7b-q5_K_M Q5_K_M 5.1 GB ~5.7 GB 80.0% 86.1
:7b-q4_K_M Q4_K_M 4.4 GB ~5.0 GB 79.7% 85.7

Q5_K_M is equal or better than Q8_0 — the 7B model is in a sweet spot where quantization doesn’t materially damage task quality.

Usage

ollama run guinogueira/ffxiv-pt-hy-mt2:7b-q5_K_M

Then prompt with:

Translate the following segment into Brazilian Portuguese, without additional explanation.

Warrior of Light stood before The Crystal Tower, watching Garlean Empire soldiers retreat across the Azim Steppe.

The model returns the surrounding text in fluent Brazilian Portuguese with proper nouns kept in English — no system prompt, no glossary.

Validation (773 hold-out examples, 890 terms)

Metric Base (maternion/hy-mt2:7b) Fine-tuned
Term preservation (raw) 58.5% 79.9% (+21.4 pp)
Term preservation (adjusted¹) 84.6%
chrF++ (PT fluency) 65.4 86.0 (+20.6)

¹ Excludes 42 false-positive terms (common English words the model correctly translates: Flag, Return, Stone, commander, etc.).

How it was built (iterative 4-phase training)

Phase Dataset Config Duration Preservation chrF++
A 9,411 train (pruned glossary, pt-BR, oversampled) r=32, 2ép, lr 1e-4 1h54m 74.8% 74.0
B 11,793 train (A + 994 augmentation, r=64) r=64, 4ép, lr 1e-4 4h42m 76.5% 72.9
C 3,852 train (hard-negative mining from A) cont A, r=32, 2ép, lr 5e-5 47 min 80.0% 84.3
D 4,464 train (2nd hard-negative mining from C) cont C, r=32, 2ép, lr 3e-5 54 min 79.9% 86.0

Key insight: continuation training with hard-negative mining (C+D) vastly outperformed brute-force scaling (B). Phase B (4h42m, r=64, 11.8k examples) only gained +1.7pp over A while degrading chrF. Phase C (47 min, same r=32, 3.8k targeted examples) gained +5.2pp preservation AND +10.3 chrF.

Training data

  • Glossary: 159,919 terms / 102,071 distinct from XIVAPI v2 (zones, duties, quests, NPCs, jobs, actions, items, mounts, minions, emotes, achievements). Pruned to 87,454 after removing 14,617 false-positive common nouns.
  • Corpus: 4,966 pages / 11.9 MB of narrative English from ffxiv.consolegameswiki.com (via MediaWiki API).
  • Dataset: Hybrid B+D gold-generation method (B = EN term-intervention prompt for natural grammar; D = placeholder masking for guaranteed preservation when B fails). Word-boundary validation rejects corrupted terms. 10% of distinct terms held out for validation.
  • Training: LLaMA-Factory QLoRA (4-bit NF4, LoRA r=32/α=64, template hy_dense_7b, grad checkpointing, bf16, effective batch 32). Phases C+D use adapter_name_or_path to continue from prior adapter.

Credits

  • Base model: tencent/Hy-MT2-7B (Tencent Hunyuan-MT 2, 7B Dense).
  • Fine-tuning framework: LLaMA-Factory.
  • GGUF toolchain: llama.cpp.
  • Game data: XIVAPI v2 + ffxiv.consolegameswiki.com.
  • All derived data is for personal, non-redistributable use; it derives from Square Enix’s game content.

License

MIT for the fine-tuning code and LoRA adapter. The base model tencent/Hy-MT2-7B has its own license — check https://huggingface.co/tencent/Hy-MT2-7B before redistribution.