Instruction-Guided Poetry Generation in Arabic and Its Dialects
| Authors | Abdelrahman Sadallah et al. |
| Year | 2026 |
| HF Upvotes | 2 |
| arXiv | 2604.27766 |
| Download | |
| Code | https://github.com/mbzuai-nlp/instructpoet-ar |
Abstract
Poetry has long been a central art form for Arabic speakers, serving as a powerful medium of expression and cultural identity. While modern Arabic speakers continue to value poetry, existing research on Arabic poetry within Large Language Models (LLMs) has primarily focused on analysis tasks such as interpretation or metadata prediction, e.g., rhyme schemes and titles. In contrast, our work addresses the practical aspect of poetry creation in Arabic by introducing controllable generation capabilities to assist users in writing poetry. Specifically, we present a large-scale, carefully curated instruction-based dataset in Modern Standard Arabic (MSA) and various Arabic dialects. This dataset enables tasks such as writing, revising, and continuing poems based on predefined criteria, including style and rhyme, as well as performing poetry analysis. Our experiments show that fine-tuning LLMs on this dataset yields models that can effectively generate poetry that is aligned with user requirements, based on both automated metrics and human evaluation with native Arabic speakers. The data and the code are available at https://github.com/mbzuai-nlp/instructpoet-ar
Engineering Breakdown
Plain English
This paper introduces the first large-scale instruction-based dataset for controllable Arabic poetry generation, addressing a gap in LLM research that has focused on poetry analysis rather than creation. The authors curated a carefully structured dataset covering Modern Standard Arabic (MSA) and multiple Arabic dialects, enabling tasks like writing poems from scratch, revising existing poems, and continuing incomplete verses based on user-specified criteria. Unlike prior work that treats poetry as an analysis problem (predicting rhyme schemes or titles), this approach trains models to generate creative content with fine-grained control over style, meter, and semantic constraints. The contribution is both a new dataset artifact and a demonstration that instruction-following LLMs can effectively handle the linguistic complexity and cultural nuances of Arabic poetry across multiple linguistic varieties.
Core Technical Contribution
The core novelty is an instruction-tuned dataset framework specifically designed for Arabic poetry generation, moving beyond the existing paradigm of analysis-only tasks. Unlike generic instruction datasets, this work captures the structural and aesthetic constraints of Arabic poetry—rhyme, meter, dialectal variation, and thematic coherence—within task specifications that guide model behavior. The authors present a structured approach to encoding poetic constraints as natural language instructions, allowing a single model to handle diverse generation modes (creation, revision, continuation) rather than requiring separate models per task. This represents the first systematic effort to operationalize poetry generation for Arabic dialects, which require handling significant morphosyntactic variation and regional linguistic features that English-only poetry datasets do not address.
How It Works
The system uses an instruction-guided generation pipeline where users provide structured prompts containing constraints such as desired rhyme scheme, meter pattern, dialect preference, and thematic keywords. These prompts are encoded as text instructions and fed into an instruction-tuned LLM (likely a fine-tuned variant of an Arabic LLM or multilingual base model), which generates poem text that respects the specified constraints. The dataset itself is organized as input-output pairs where each input is a natural language instruction describing the poetic task, and each output is a reference poem or poem fragment that satisfies those constraints. During inference, the model performs conditional generation: it processes the instruction embedding, maintains awareness of Arabic grammatical structure and the chosen dialect, and generates tokens autoregressively while applying constraint satisfaction mechanisms (e.g., checking rhyme consistency or meter adherence). The approach likely incorporates a retrieval or ranking component to validate generated poetry against poetic quality metrics, and may use techniques like constrained decoding to enforce hard constraints like rhyme endings.
Production Impact
For production systems, this work enables building Arabic poetry writing assistants that can serve educational platforms, creative writing tools, and cultural heritage applications. Engineers adopting this approach would need to integrate instruction-tuned inference into their serving infrastructure, with consideration for latency since constraint validation (rhyme checking, meter verification) adds computational overhead to the generation pipeline. The main trade-off is between generation quality and speed: naive constraint checking requires post-hoc filtering of generated text, while tighter constraint integration (e.g., via constrained decoding or token masking) increases per-token latency but improves output validity rates. A critical production decision is dialect handling—you must either train separate models for each dialect or use a single multilingual model with explicit dialect tokens, which affects model size and inference cost. Real-world deployment would require building evaluators that assess both linguistic correctness (proper rhyme and meter in each target dialect) and poetic quality, since LLM outputs may be grammatically valid but aesthetically poor.
Limitations and When Not to Use This
The paper is limited by its focus on MSA and unspecified dialects; production use requires clarity on which dialects are actually covered and whether morphological tools for dialect-specific validation are available. The abstract does not describe the dataset size or quality control methodology, raising questions about whether the curated dataset is large enough to prevent model hallucinations and whether human evaluation ensures poetic authenticity. Instruction-tuned models may struggle with fine-grained poetic constraints (e.g., specific meter patterns that are rare in training data), particularly for archaic or specialized poetic forms that pre-date Modern Standard Arabic. The approach assumes that natural language instructions can fully capture poetic intent, but much of poetry's power derives from ambiguity and double meaning that rigid instructions may suppress. Additionally, the paper does not address cross-dialect generation (e.g., can a single model generate high-quality poetry in both Egyptian and Levantine Arabic?) or how the system handles the gap between colloquial and formal registers that is especially acute in Arabic linguistic variation.
Research Context
This work builds on a decade of instruction-tuning research (InstructGPT, FLAN, etc.) but applies it to a linguistically and culturally specific domain where prior datasets do not exist. It extends Arabic NLP research, which has historically focused on morphological analysis and machine translation, into the creative generation space. The paper opens a new benchmark area: controllable poetry generation for non-English, morphologically rich languages, which challenges the assumption that English-optimized techniques transfer directly to highly inflectional and dialectally varied languages. Future work likely includes scaling to more dialects, incorporating meter and rhyme as explicit loss terms during training rather than post-hoc constraints, and building downstream applications like poetry translation, style transfer, and dialect-specific generation quality metrics.
:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::
