P ah G en: Generating A ncient P ahlavi Text via Grammar-guided Zero-shot Translation (2025)

Abstract: The Pahlavi language, aka Middle Persian, is a critical part of Persian cultural and historical heritage which bridges the Old Persian and Modern Persian (Farsi). However, due to its limited digital presence and the scarcity of comprehensive linguistic resources, Pahlavi is at risk of extinction. As an early attempt to preserve this language, this study introduces a framework to translate English text into Pahlavi. Our approach combines grammar-guided term extraction with zero-shot translation, leveraging large language models (LLMs) to generate syntactically and semantically accurate Pahlavi sentences.This framework aims to preserve the Pahlavi language and serves as a model for reviving other endangered languages with similar characteristics. Finally using our framework, we generate a novel dataset of 360 expert-validated parallel English-Pahlavi texts.

## introduction the pahlavi language, or middle persian, was the official language of the sasanian empire, bridging old and modern persian @xcite . it was historically used across regions of present-day iran, afghanistan, pakistan, and beyond. despite its significance, pahlavi faces extinction due to limited digital representation and scarce linguistic resources @xcite . efforts to digitize its scripts via ocr exist @xcite , but most materials stem from incomplete transcriptions of ancient manuscripts and zoroastrian texts, lacking standardized character sets. the preservation and revitalization of endangered languages have garnered attention in the field of natural language processing (nlp). recent works @xcite have highlighted challenges and advancements in this area. large language mod-* these authors contributed equally to this work els (llms) have demonstrated adaptability to new tasks @xcite , especially translating into an unseen or lowresource languages @xcite @xcite ; however, their application as end-to-end translators for languages like pahlavi is hindered due to the lack of digital resources in their original form on the internet, making it difficult for llms to train effectively @xcite . translation requires an understanding of the semantic and syntactic structures of both languages. language learners use translation as a means for learning a new language @xcite . therefore, exploring the translation mechanism from a well-known language like english to an ancient language like pahlavi can lay the foundation for further preservation efforts. this approach not only helps safeguard the language but also raises awareness within communities by enabling a deeper understanding of its nuances. developing a method by which new pahlavi text is generated also serves as a new resource with modern concepts. however, translating from english to the pahlavi language has its challenges. it involves adapting tenses to align with aspectual distinctions, accommodating the lack of gendered pronouns, and the absence of terms for contemporary concepts such as "website," or "tennis racket." in this paper, we present pahgen, a framework designed to translate english text into pahlavi. our approach integrates grammar-guided term extraction with zero-shot translation techniques, utilizing llms to generate pahlavi sentences that are both syntactically and semantically accurate. we evaluated our framework on a set of manually crafted parallel sentences between english and pahlavi. additionally, we constructed a parallel english-pahlavi dataset using our framework, which was manually validated by language experts. as the first endeavor in this domain, we publicly release our dataset foot_0 , providing a foundation for researchers to build upon and advance this work. for end-to-end translation from english to pahlavi, we initially experimented with few-shot llm prompting, both with and without providing vocabulary. however, the models often hallucinated nonsensical characters resembling the pahlavi script, revealing their lack of understanding of its semantic and syntactic structure. to address this, we combined handcrafted rules for grammatical and semantic roles with llms to compile sentence components. this approach, common in lowdata scenarios, is supported by heuristics and feature handcrafting @xcite @xcite . section 3 presents our proposed methodology in detail. section 4 describes the dataset validation process, followed by comprehensive performance analysis in section 5. we introduce our novel dataset in section 6 and present preliminary experiments with llms along with their implications for the machine translation community in section 7. section 8 discusses the limitations and future directions of our work, and finally, section 9 concludes the paper. we hope that our approach-preserving pahlavi texts through translation by generating pahlavi text from english-facilitates a deeper understanding of the pahlavi language and serves as a model for similarly presenting other languages. this work not only aids in the preservation of pahlavi but also provides a replicable framework for revitalizing other endangered languages with comparable structural features. ## related work researchers have explored machine translation for low-resource languages, such as urdu @xcite , in the modern nlp. while some of them tried to leverage existing data sources like verses and prose @xcite to enhance the translation accuracy, others equipped state-of-theart models such as transformers @xcite and llms @xcite to do so. in addition, two research directions that are more closely related to our work are presented below. translating to preserve endangered languages. preserving a language through translation extends beyond linguistic conversion to include cul-tural and contextual nuances. as rout (2020) highlights, translation is key to preserving language and culture, yet challenges arise when region-specific words lack direct equivalents in the target language. comparative studies on odisha and assam's folk literature reveal lexical disparities and sociocultural differences that complicate translation. @xcite emphasizes that cultural awareness is essential to maintaining linguistic integrity. machine translation, as discussed by @xcite , offers a tool for documenting endangered languages, though the absence of structured lexicons remains a hurdle. researchers have explored methods for translating texts from highresource languages to endangered ones, such as @xcite , who introduced a retrieval module to llms for cherokee, tibetan, and manchu, and @xcite , who examined personalized tetun translation. beyond language preservation, nlp techniques also address societal issues, as demonstrated by @xcite , who developed an automated system to analyze gender representation in french-language media. while most translation-based efforts focus on spoken languages @xcite , some, like @xcite , have instructed llms to translate spanish into 11 indigenous american languages to aid in preservation. literary translations further embed cultural values, ensuring linguistic heritage is maintained across generations and geographies. rule-based translation. the nuances behind low-resource languages, especially ancient ones, make their end-to-end translation hard. in addition, end-to-end translators usually have less interpretability. therefore using rule-based methods for their translation is preferred. for example, @xcite presented an open-source rule-based tool for apertium translation. some researchers utilized the rule-based method in their framework for better accuracy when dealing with low-resource languages @xcite , even with the existence of llms to yield better translations @xcite . our work bridges the gap between these two niche research directions by proposing a translation framework and an expert-validated automatically generated dataset that produces insights into the pahlavi language for the machine translation community and language learners. ## method for translating english text to pahlavi with book pahlavi script, we employed a structured pipeline which has 4 steps. the steps in our approach are as follows: an overview of our method is shown in figure 1 , and the following sections provide detailed explanations of each step. ## evaluation dataset to assess our model's performance, we developed a parallel pahlavi-english test dataset. this dataset comprises 200 sentence pairs, including genuine excerpts from historical books and inscriptions, alongside sentences from various domains such as art, fruits, and animals. to construct this dataset, we followed a structured process: (a) we initially generated text covering several domains, utilizing diverse grammatical structures in english, with sentences composed of 5 to 12 words. (b) we filtered these sentences to include only those with words that are present in our dictionary or are translatable into pahlavi, deliberately excluding terms that would not have existed during the sassanian era, such as "airplane." (c) these selected sentences underwent expert translation and thorough quality checks by additional experts to ensure high accuracy. additionally, we enriched our dataset with data from historical books and inscriptions, using the same selection criteria and processes used for our synthetically generated content. our dataset consists of 200 sentences, with an average length of 7.5 words per sentence. it includes two categories: 167 sentences from created texts and 33 sentences from historic texts. the dataset contains a total of 402 unique words. ## results to evaluate the effectiveness of our proposed english-to-pahlavi machine translation framework, we assess two baselines: (1) zero-shot and (2) zeroshot learning with vocabulary. we evaluated these baselines using two types of assessment. first, we applied well-known translation metrics, such as bleu @xcite and chrf @xcite , to measure translation quality, which is particularly useful for languages with complex sentence structures. additionally, since word order in pahlavi can vary while preserving meaning and these metrics have false negatives, we conducted human evaluations following prior studies @xcite @xcite to assess our model's output qualitatively as well. this allowed us to gain a more comprehensive understanding of our model's output. ## parallel dataset creation we utilized our framework to generate a larger parallel english-pahlavi dataset. this dataset is intended to facilitate further research in pahlavi language processing by offering a dataset that can serve as a useful resource for this low-resource language. the dataset includes 360 sentence pairs spanning diverse domains. sentences were selected and filtered based on linguistic diversity, domain coverage, and grammatical complexity. ## discussion this section first examines our attempts to use llm as end-to-end translators and provides preliminary explanations for why we believe it fails. we then theme english pahlavi daily activities the boy runs with the dog for exercise. rēdak abāg sag daved varzišn kirdan rāy. geography, flora & fauna in the garden, the cat chases the butterflies. the merchant trades silk for gold. vāzāragān abrēšum vahāg kuned zarr rāy. family & social life ## limitations and future work this work is among the first to contribute to the preservation of the ancient pahlavi language and like any other work, has specific limitations. ## conclusion our study presented a framework for translating english text into pahlavi, combining grammar-guided term extraction with zero-shot translation and leveraging large language models (llms) to generate syntactically and semantically accurate sentences. this approach not only aids in the preservation of pahlavi but also serves as a model for reviving other endangered languages. we also created a novel dataset of 360 expert-validated parallel english-pahlavi texts, which is publicly available to support further research and advancements in this field. by addressing key challenges in low-resource language translation, this work lays the foundation for future efforts in both ancient and modern language preservation. proceedings of the seventh workshop on technologies for machine translation of low-resource languages (loresmt 2024), pages 50-56, bangkok, thailand. association for computational linguistics. henry g widdowson. 2014. the role of translation in language learning and teaching, pages 222-240. springer, london. kaitlyn zhou, dan jurafsky, and tatsunori hashimoto. 2023. navigating the grey area: how expressions of uncertainty and overconfidence affect language models. in proceedings of the 2023 conference on empirical methods in natural language processing, pages 5506-5524, singapore. association for computational linguistics.