A domain-adapted T5 encoder-decoder for Koine Greek, produced by
training LoRA adapters on GreTa (a Classical Greek T5) with a
1.5M-token Koine corpus and a Classical Greek replay buffer.
KoineFormer adapts
GreTa---a
T5-base model trained on Classical and Medieval Greek by Heidelberg
NLP---to
Koine Greek, the Hellenistic dialect of the New
Testament, Septuagint, and Apostolic Fathers.
KoineFormer improves POS accuracy by 1.30 points (28% relative error
reduction) over zero-shot. Lemmatisation accuracy is comparable
(82.4% vs.\ 81.3%)---span-corruption DAPT improves syntactic
representations but does not expand vocabulary coverage. Full
fine-tune lemma results are pending.
1from peft import PeftModel
2from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3
4base = AutoModelForSeq2SeqLM.from_pretrained("bowphs/GreTa")
5model = PeftModel.from_pretrained(
6 base, "ainouche-abderahmane/koineformer"
7).merge_and_unload() # bake LoRA into base weights
8tokenizer = AutoTokenizer.from_pretrained("bowphs/GreTa")
9tokenizer.add_special_tokens({"pad_token": "[PAD]"})
10model.resize_token_embeddings(len(tokenizer))
11
12# Fill-in-the-blank: comma marks the missing word
13text = "Ἀρχὴ τοῦ, Ἰησοῦ Χριστοῦ υἱοῦ θεοῦ."
14inputs = tokenizer(text, return_tensors="pt")
15outputs = model.generate(
16 **inputs, max_new_tokens=40, num_beams=5,
17 no_repeat_ngram_size=3, repetition_penalty=2.0,
18 early_stopping=True, pad_token_id=tokenizer.pad_token_id,
19)
20print(tokenizer.decode(outputs[0], skip_special_tokens=True))
21# → πρώτην τοῦ εὐαγγελίου ἰησοῦ χριστοῦ υἱοῦ θεοῦ.
A Classical Greek replay buffer (First1KGreek: Homer, Plato, Xenophon)
was interleaved at 30% to prevent catastrophic forgetting.
1@inproceedings{ainouche2026koineformer,
2 title = {KoineFormer: Domain-Adaptive Language Modeling for Koine Greek},
3 author = {Ainouche, Abderahmane},
4 booktitle = {Proceedings of LaTeCH-CLfL},
5 year = {2026},
6}
CC-BY-SA 4.0 (MorphGNT share-alike requirement).