CoolFace
Modelpublic

ilsp/m2m100-1.2B-ag-mg-qlora

sourceHugging Facemitupdated 4mo agoView on Hugging Face
1likes
Model Card

M2M100-1.2B for Ancient Greek to Modern Greek (QLoRA)

![DOI](https://doi.org/10.63317/4cdk64dgm2w9)

This model is a fine-tuned version of facebook/m2m100_1.2B for translating Ancient Greek to Modern Greek.

It was fine-tuned using QLoRA (4-bit Quantization + LoRA) on the sentence-level AG-MG Parallel Corpus.

The tokenizer has been expanded with 122 Ancient Greek characters (Polytonic) that were missing from the original M2M100 vocabulary and are essential for handling the source text correctly.

This model was trained by Spyridon Mavromatis at the Institute for Language and Speech Processing (ILSP), "Athena" RC, and the National and Kapodistrian University of Athens (NKUA) as part of an M.Sc. thesis.


Model Details

  • —Base Model: facebook/m2m100_1.2B
  • —Method: QLoRA (Rank=16, Alpha=32, 4-bit NF4)
  • —Vocabulary: Expanded with 122 Polytonic Greek characters.
  • —Training Data: ~130k sentence pairs from the AG-MG Corpus.

Usage

You need to load the base model, resize the embeddings, and then load the Peft adapter. If you want to load the base model in 4-bit you need bitsandbytes installed.

python

import torch

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, BitsAndBytesConfig

from peft import PeftModel

# 1. Configuration

adapter_repo = "ilsp/m2m100-1.2B-ag-mg-qlora"

base_model_id = "facebook/m2m100_1.2B"

# 2. Load Tokenizer (from adapter repo for added tokens)

tokenizer = AutoTokenizer.from_pretrained(adapter_repo, src_lang="el") # We treat AG as 'el' script-wise

# 3. Load Base Model in 4-bit

bnb_config = BitsAndBytesConfig(

    load_in_4bit=True,

    bnb_4bit_quant_type="nf4",

    bnb_4bit_compute_dtype=torch.bfloat16,

    bnb_4bit_use_double_quant=True

)

model = AutoModelForSeq2SeqLM.from_pretrained(

    base_model_id, 

    quantization_config=bnb_config, 

    device_map="auto"

)

# 4. Resize Embeddings (Critical)

model.resize_token_embeddings(len(tokenizer))

# 5. Load Adapter

model = PeftModel.from_pretrained(model, adapter_repo)

model.eval()

# 6. Inference

text = "Ὦ ξεῖν', ἀγγέλλειν Λακεδαιμονίοις ὅτι τῇδε κείμεθα."

inputs = tokenizer(text, return_tensors="pt").to(model.device)

# Force target language to Modern Greek ('el')

forced_bos_token_id = tokenizer.get_lang_id("el")

translated_tokens = model.generate(

    **inputs, 

    forced_bos_token_id=forced_bos_token_id, 

    max_length=128

)

print(tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0])

Performance

Main Test Set Results

Evaluated on the 2,000 sentence-pairs Test Set (Attic & Koine Hellenistic dialects).

**Model****Method****BLEU ↑****chrF++ ↑****TER ↓****BERTScore F1 ↑****COMET ↑****ΔBLEU**
NLLB-600MBase1.5516.86106.800.8800.539-
LoRA7.4329.3188.320.9030.667+5.88
NLLB-1.3BBase2.1517.78106.410.8850.573-
LoRA8.0130.0287.740.9050.687+5.86
M2M100-1.2BBase0.6210.70100.500.8580.475-
👉QLoRA10.9633.0982.990.9110.710+10.34
Full FT9.6031.1683.430.9080.692+8.98
Krikri-8B-InstructBase8.2929.8788.130.8950.695-
QLoRA11.9034.0784.160.9060.713+3.60
Full FT13.1634.7183.680.8480.702+4.45

Stress Set Results (Rare Dialects)

Evaluated on the 250 sentence-pairs Stress Set (Ionic, Doric, Homeric dialects).

**Model****Method****BLEU ↑****chrF++ ↑****TER ↓****BERTScore F1 ↑****COMET ↑****ΔBLEU**
NLLB-600MBase0.7714.40118.130.8660.484-
LoRA5.6528.7488.010.9000.638+4.89
NLLB-1.3BBase1.2516.15107.030.8730.525-
LoRA5.6828.9488.240.9000.656+4.43
M2M100-1.2BBase0.079.37100.340.8400.427-
👉QLoRA9.5233.3081.950.9110.691+9.45
Full FT8.1631.1283.110.9070.664+8.09
Krikri-8B-InstructBase6.5528.9887.380.9000.675-
QLoRA10.3734.0982.280.9110.717+3.82
Full FT12.8035.9081.400.8840.716+6.11

Citation

If you use this model, please cite our LREC 2026 paper:

Mavromatis, S., Sofianopoulos, S., Prokopidis, P., & Giagkou, M. (2026). Ancient Greek to Modern Greek Machine Translation: A Novel Benchmark and Fine-Tuning Experiments on LLMs and NMT Models. In Proceedings of the Fifteenth Language Resources and Evaluation Conference (LREC 2026) (pp. 8685–8698). European Language Resources Association (ELRA). https://doi.org/10.63317/4cdk64dgm2w9
bibtex
@inproceedings{mavromatis-etal-2026-ancient,
  title     = {Ancient Greek to Modern Greek Machine Translation: A Novel Benchmark and Fine-Tuning Experiments on LLMs and NMT Models},
  author    = {Mavromatis, Spyridon and Sofianopoulos, Sokratis and Prokopidis, Prokopis and Giagkou, Maria},
  booktitle = {Proceedings of the Fifteenth Language Resources and Evaluation Conference (LREC 2026)},
  month     = {May},
  year      = {2026},
  pages     = {8685--8698},
  address   = {Palma, Mallorca, Spain},
  publisher = {European Language Resources Association (ELRA)},
  editor    = {Piperidis, Stelios and Bel, Núria and van den Heuvel, Henk and Ide, Nancy and Krek, Simon and Toral, Antonio},
  doi       = {10.63317/4cdk64dgm2w9}
}

Note on resources: The fine-tuned models are publicly released. The accompanying AG-MG Parallel Corpus is not publicly distributed due to the complex and uncertain copyright status of the source materials.