Downloads · 30 days
13
8% of all-time downloads
ainouche-abderahmane/koineformer
koineformer is a text generation model from ainouche-abderahmane. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as cc-by-sa-4.0.
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.
Downloads · 30 days
13
8% of all-time downloads
All-time downloads
156
Public
Repo size
15 MB
Likes
0
Public
Click a slice to open those files.
.safetensors15 MB · 100%
From the Hugging Face model README
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.
The adaptation uses LoRA (Low-Rank Adaptation) to train only 3.7M of the model's 220M parameters, producing a 14 MB adapter checkpoint. Training takes under one hour on a single GPU.
| Property | Value |
|---|---|
| Base model | bowphs/GreTa (T5-base, 220M) |
| Adaptation | LoRA (r=16, α=32) |
| Trainable params | 3.7M (1.5%) |
| Training corpus | 1.5M Koine tokens + Classical replay |
| Training time | 58 minutes (NVIDIA A10G) |
| POS accuracy | 96.62% (linear probe) |
| Lemma accuracy | 81.34% (linear probe) |
| Adapter size | 14 MB |
| License | CC-BY-SA 4.0 |
Linear probe evaluation on the SynoptiQ Corpus test set:
| Model | POS | Lemma | Params | Checkpoint |
|---|---|---|---|---|
| GreTa (zero-shot) | 95.32% | 82.37% | 0 | 880 MB |
| Full fine-tune | 96.11% | — | 220M | 880 MB |
| KoineFormer (LoRA) | 96.62% | 81.34% | 3.7M | 14 MB |
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.
from peft import PeftModel
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
base = AutoModelForSeq2SeqLM.from_pretrained("bowphs/GreTa")
model = PeftModel.from_pretrained(
base, "ainouche-abderahmane/koineformer"
).merge_and_unload() # bake LoRA into base weights
tokenizer = AutoTokenizer.from_pretrained("bowphs/GreTa")
tokenizer.add_special_tokens({"pad_token": "[PAD]"})
model.resize_token_embeddings(len(tokenizer))
# Fill-in-the-blank: comma marks the missing word
text = "Ἀρχὴ τοῦ, Ἰησοῦ Χριστοῦ υἱοῦ θεοῦ."
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(
**inputs, max_new_tokens=40, num_beams=5,
no_repeat_ngram_size=3, repetition_penalty=2.0,
early_stopping=True, pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# → πρώτην τοῦ εὐαγγελίου ἰησοῦ χριστοῦ υἱοῦ θεοῦ.
| Source | Tokens | Description |
|---|---|---|
| SBLGNT | ~773K | Full Greek New Testament (27 books) |
| Apostolic Fathers | ~732K | 1-2 Clement, Ignatius, Polycarp, Didache |
A Classical Greek replay buffer (First1KGreek: Homer, Plato, Xenophon) was interleaved at 30% to prevent catastrophic forgetting.
python scripts/train_dapt.py --smoke-testFull pipeline at SynoptiQ.
@inproceedings{ainouche2026koineformer,
title = {KoineFormer: Domain-Adaptive Language Modeling for Koine Greek},
author = {Ainouche, Abderahmane},
booktitle = {Proceedings of LaTeCH-CLfL},
year = {2026},
}
Evaluated on the SynoptiQ Corpus.
CC-BY-SA 4.0 (MorphGNT share-alike requirement).