Manuscript Offprint

arXiv:2610.31723

LAMB: A Modern Contextual Language Model for Latin

Aidan McCarthy

Abstract

This article introduces Latin Modern BERT (LAMB), an encoder for the Latin language based on the ModernBERT architecture, pretrained in two phases on more than 74B Latin tokens using a novel morphologically informed masking regimen.

We also present two corpora for the Latin language. Acervus contains 24B BERT WordPiece tokens, including over 760K samples from heavily damaged OCR transcriptions, repaired by a ByT5 model trained for Latin text repair. The second dataset, Corpus Trinum, contains a mixture of over 100M strong and weak Latin language semantic triplets. Corpus Trinum is the first Latin semantic triplet dataset, opening the door for Latin language models to be adapted to general sentence semantic similarity tasks.

We construct an experimental grid using five tasks and seventeen subtasks, applying a variety of finetuning configurations and subword aggregation techniques for 15 pretrained encoders, 6 LAMB training checkpoints, and an ablation model designed to quantify the impact of different masking regimens. Using this benchmark, we rank Latin encoders and find that LAMB outperforms all other evaluated models on 16 of 17 subtasks, coming within 0.8 percentage points of state of the art on the seventeenth.

We provide additional analyses relating Latin encoder performance to tokenizer behavior, syntactic structure, finetuning configuration, pretraining state, subword aggregation, and variation in source texts and domains. In these, we identify unique acquisition dynamics for Latin open class words during terminal decay phases, and establish that for some task categories, finetuning configuration selection can have a greater effect on downstream scores than additional pretraining tokens.

1 Introduction

Latin was one of the first languages to be examined through a computational lens. As early as the middle of the twentieth century, Roberto Busa, in collaboration with IBM, initiated the digitization of Thomas Aquinas' complete works. (Busa, 2005) Despite occupying a prominent position in the then-nascent field of computational linguistics, there are relatively few contemporary Latin encoder models. Of those which exist, most are underpowered and out of date when compared to mainstream masked language models for high resource languages.

The disparity is not for a lack of effort or demand. Rather, training an encoder on Latin text is hindered by a number of methodological obstacles unique to the language. A primary obstruction is the absence of corpora on a sufficient scale to train a masked language model, a process which requires vast quantities of digitized text. Much of the data used to train models like RoBERTa (Liu et al., 2019) was obtained from, and authored on, the open internet, a massive source of digital born text in a variety of registers, modalities, and lects. Vernacular Latin use ended before the introduction of the internet. As a result, the language does not feature the same kind of pretraining resources.

Scarcity is not the only challenge. Prior research highlights the significant diachronic (Cuscito et al., 2025) and orthographic (Clérice et al., 2025) variation present in existing corpora. Corpora for high resource languages, the models pretrained on them, and their evaluations are typically fairly synchronic and can afford to be so. Modern En-glish, dating roughly from the Great Vowel Shift (Baugh and Cable, 1993) to present day, spans at most 500 to 600 years, and the English text aggregated from sites like Wikipedia was likely only authored within the past twenty years.

The Praeneste fibula (Gordon, 1975), thought to be among the earliest examples of Latin, dates to the seventh century BC. From there on, the Latin language evolved, gradually diverging into the Romance languages, with the distinction between Classical Latin and the spoken vernacular being sharpened by Carolingian reform in the ninth century. Even after this, Latin continued to see widespread use in ecclesiastical, scholastic, and literary registers, including among Renaissance humanists in the fifteenth and early sixteenth centuries. Consequently, Latin samples are drawn from a chronological range almost four times greater than that of Modern English, and more than a hundred times greater than the temporal span represented by the bulk of the text in typical web crawls.

This linguistic range, already expansive, says nothing of topical drift and shifting meaning over long stretches of time. As Riemenschneider and Frank (2023a, p. 15182) write, a modern language model, and thus its pretraining corpus, “is familiar with contemporary concepts like cell phones or communism, which are unknown to antiquity.” In English, consider the potential meaning of the word tablet, even over the past century.

Scarcity and variation aside, the Latin language itself may also pose several mechanical obstacles. Many of the assumptions at the core of language modeling, such as proximity-based positional encoding, are predicated on features specific to the English language, and its linguistic properties. These do not necessarily hold for Latin. Recent work in Latin contextual language models suggests that processes like tokenization may be complicated by the rich inflectional morphology (Hudspeth et al., 2025) of Latin, and Cotterell et al. (2020) directly argue that complex inflection is inherently challenging to language models. Beyond surface forms, it is entirely possible that the comparatively flexible syntactic structure (Gildea and Temperley, 2007) require special considerations.

Some recent language models incidentally target low resource languages, such as Latin, by using massive language indiscriminate corpora. (Marone et al., 2025; Conneau et al., 2020) These models, although they use state of the art techniques, are designed to be generalists. This is not always beneficial, as recent research has suggested that multilingual performance may come at the cost of domain specific performance. (Zhou and Matusevych, 2025) Furthermore, the methodologies of these generalist models do not seek to account for operational constraints unique to every language, such as the prevalence of pseudo-Latin (Lorem Ipsum), widely used as placeholder text online and a highly adversarial training signal for Latin.

This work applies recent progress in encoder architecture and training (Weller et al., 2026; Nussbaum et al., 2025) to a dedicated Latin language model, making considerations for the attributes that distinguish Latin from the modern high resource languages.

References (34)