All of this Readme is generated by Claude 4.6 Sonnet!
NLLB-200-distilled-600M: English ↔ Middle English
A LoRA adapter fine-tuned on top of facebook/nllb-200-distilled-600M for bidirectional translation between Modern English and Middle English (Wycliffe/Chaucer era, ~1380–1400).
Model Description
This adapter teaches NLLB-200 to translate between Modern English and Middle English in the style of the Wycliffe Bible (~1382). It is the faithful back-translation component of a two-model pipeline — optimized for meaning preservation rather than stylistic fluency.
The companion fluency model (Qwen3-4B LoRA) is trained using synthetic data generated by this model.
Benchmark Results
Evaluated on 100 held-out verse pairs from the Wycliffe Bible vs. KJV.
Metric
Score
chrF++
51.46
BLEU
30.51
Note: The gap between chrF++ and BLEU is expected — BLEU penalizes valid Middle English spelling variants (e.g. ech vs euery, figis vs figus). chrF++ is the more appropriate metric for this task.
Training Details
Parameter
Value
Base model
facebook/nllb-200-distilled-600M
LoRA rank
16
LoRA alpha
32
Target modules
q_proj, k_proj, v_proj, out_proj, fc1, fc2
Trainable params
8,650,752 (1.39%)
Training data
Wycliffe Bible vs. KJV (~27k pairs)
MAX_LEN
128 tokens
Batch size
16
Gradient accumulation
2 (effective batch 32)
Epochs
3
Learning rate
5e-4
Label smoothing
0.1
Hardware
NVIDIA T4 (16GB)
Training time
8428s (~2h20min)
Samples/sec
19.2
Total FLOPS
4.49 × 10¹⁶
Average train loss
3.215
Final step train loss
2.907 (step 5000)
Final val loss
3.024 (step 5000)
Training Curve
Step
Train Loss
Val Loss
500
3.5559
3.7685
1000
3.3317
3.4527
1500
3.2002
3.2972
2000
3.0826
3.2185
2500
3.0477
3.1452
3000
3.0020
3.0992
3500
2.9551
3.0730
4000
2.9471
3.0504
4500
2.9321
3.0293
5000
2.9070
3.0241
Data
Training data sourced from two public domain texts, aligned by book/chapter/verse:
Wycliffe Bible (~1382) — Middle English source
King James Version (1611) — Modern English target
Note: KJV is Early Modern English (1611), not contemporary Modern English. This means the model performs best on formal/biblical register input. For everyday modern text, use the companion Qwen3-4B LoRA adapter.
Data pipeline available at: [me_data_pipeline.py]
Usage
python
1from transformers import NllbTokenizer, AutoModelForSeq2SeqLM
2from peft import PeftModel
3import torch
45MODEL_ID ='facebook/nllb-200-distilled-600M'6ADAPTER ='MihaiPopa-1/NLLB-200-Distilled-600M-Middle-English'# update with your HF repo78tokenizer = NllbTokenizer.from_pretrained(MODEL_ID)9ME_TOKEN ='enm_Latn'10if ME_TOKEN notin tokenizer.additional_special_tokens:11 tokenizer.add_special_tokens({'additional_special_tokens':[ME_TOKEN]})1213ME_TOKEN_ID = tokenizer.convert_tokens_to_ids(ME_TOKEN)1415model = AutoModelForSeq2SeqLM.from_pretrained(16 MODEL_ID,17 torch_dtype=torch.float16,18 device_map='auto'19)20model.resize_token_embeddings(len(tokenizer))21model = PeftModel.from_pretrained(model, ADAPTER)22model.eval()2324deftranslate(text, src_lang='eng_Latn', tgt_token_id=ME_TOKEN_ID):25 tokenizer.src_lang = src_lang
26 inputs = tokenizer(text, return_tensors='pt', truncation=True, max_length=64).to(model.device)27with torch.no_grad():28 out = model.generate(29**inputs,30 forced_bos_token_id=tgt_token_id,31 max_new_tokens=64,32 num_beams=433)34return tokenizer.decode(out[0], skip_special_tokens=True)3536# Modern English → Middle English37print(translate("I will call you later tonight."))38# → "Y schal clepe to thee later this nyyt."3940print(translate("She works at the hospital downtown."))41# → "Sche werkith in the hospital in the myddil of the town."4243# Middle English → Modern English44EN_TOKEN_ID = tokenizer.convert_tokens_to_ids('eng_Latn')45print(translate("Y haue not etun ony thing fro breakfast.", src_lang='enm_Latn', tgt_token_id=EN_TOKEN_ID))46# → "I have not eaten anything since breakfast."
Sample Outputs
Modern English
Middle English
I will call you later tonight.
Y schal clepe to thee later this nyyt.
The weather is really nice today.
The weier is trewe to dai.
Did you see the news this morning?
Whether thou seest the wordis of the morewtid?
My phone battery is dead.
My phone baterie is deed.
Let's meet at the coffee shop at noon.
Meete we in the coffee shop at noon.
She works at the hospital downtown.
Sche werkith in the hospital in the myddil of the town.
I haven't eaten anything since breakfast.
Y haue not etun ony thing fro breakfast.
Limitations
KJV register bias — training data is formal Biblical prose. Casual modern slang may produce stilted output.
Post-1400 vocabulary — words like coffee, phone, traffic have no ME equivalent and are either left in modern form or phonologically naturalized.
Proper nouns — Hebrew/Latin proper nouns from the Bible are sometimes mis-transcribed into ME phonology (e.g. Shupham → Sufam).
Sequence length — trained with MAX_LEN=64; very long sentences may be truncated.
Pipeline
This model is part of a two-model English ↔ Middle English translation system:
NLLB-600M LoRA → faithful back-translation → synthetic training data
↓
Qwen3-4B LoRA → fluent, natural ME output → daily use (texts, messages)
Citation
If you use this model, please cite:
@misc{nllb-middle-english-lora,
title = {NLLB-200 LoRA: English ↔ Middle English Translation},
year = {2025},
note = {Fine-tuned on Wycliffe Bible / KJV parallel corpus}
}