arXiv:2610.09756cs.CLOct 2026

Manuscript Offprint

arXiv:2610.09756

Shaer: Controlled Arabic Poetry Generation with Meter Subform and Semantic Conditioning

Ahmad Abbas, Tamara Fakih, Nour Fakih, Ammar Mohanna

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Classical Arabic poetry generation requires simultaneously satisfying semantic, linguistic, and fine-grained prosodic constraints. Existing systems typically control broad poetic attributes but do not jointly model semantic intent, meter subform, and poem length. We present SHAER, a controllable Classical Arabic poetry generation framework jointly conditioned on natural-language descriptions, meter subforms, and target hemistich counts. To support this task, we construct an enriched corpus of 116,032 classical Arabic poems derived from Ashaar, containing normalized meter-subform labels and automatically generated, validated semantic descriptions. We then adapt Yehia-7B using QLoRA-based supervised fine-tuning with a completion-only objective. Our evaluation combines automatic assessment of base-meter conformity, requested-subform adherence, and length control with three LLM judges, blinded human evaluation, and memorization analysis. SHAER achieves 95.17% base-meter accuracy, 91.75% poem-level meter-subform accuracy, and 83.40% exact count accuracy. Relative to its untuned foundation model, these results represent gains of 68.68, 57.77, and 38.93 percentage points, respectively; SHAER also attains the highest base-meter accuracy among all evaluated systems. Multi-LLM evaluation and a blinded human assessment of top-ranked outputs further indicate competitive semantic and literary quality. Finally, analysis of all 3,481 test generations finds no exact copies from the training corpus or paired source poems. Code, models, and datasets are publicly available. 1^{1}

1 Introduction

Classical Arabic poetry is a central component of Arabic literary heritage, making controlled generation both a technically challenging problem and a culturally grounded Arabic NLP task. Unlike conventional language generation tasks, successful poetry generation must simultaneously satisfy semantic, stylistic, and prosodic constraints. Beyond producing fluent and coherent text, a generated poem must adhere to a prescribed meter while faithfully expressing the intended meaning. These requirements make Arabic poetry generation a particularly demanding controllable generation problem. A brief overview of Classical Arabic poetic structure, meter, and meter subforms is provided in Appendix A.

Despite recent progress in Arabic language generation and computational poetry, fine-grained control over generated Arabic poetry remains challenging. Existing generation settings largely operate over broad structural or categorical attributes, leaving important dimensions of poetic control insufficiently addressed. In particular, jointly controlling natural-language semantic intent, fine-grained meter subforms, and explicit poem length remains underexplored. This limits the ability to generate poems that simultaneously realize a desired meaning and satisfy precise prosodic and structural requirements.

To address these gaps, we introduce SHAER, a controllable Arabic poetry generation framework that jointly models semantic intent and poetic structure. By conditioning generation on natural-language descriptions, meter subforms, and target hemistich counts, SHAER enables fine-grained control over meaning, meter, and poem structure. Figure 1 presents representative poems generated by SHAER from prompts drawn from the test split of the released dataset.

Our contributions are as follows: (1) We introduce a controllable Arabic poetry generation task conditioned jointly on semantic descriptions, meter subforms, and requested poem length, enabling fine-grained control over semantic and structural properties. (2) We construct an enriched Arabic

1^{1}Code: https://github.com/AhmaddAbbass/Shaer. Models and datasets: https://huggingface.co/Shaer-AI.

Figure

Figure 1: Example poems generated by Shaer. Each poem is generated from a semantic description, meter specification, and length constraint derived from a held-out test example.

poetry corpus derived from Ashaar, comprising 116,032 classical poems annotated with normalized meter subforms and semantic descriptions, together with the complete data processing pipeline. (3) We develop SHAER, a controllable Arabic poetry generation model built by adapting Yehia-7B, a strong Arabic-focused language model, through parameter-efficient fine-tuning and explicit conditioning on semantic and prosodic constraints. (4) We introduce a multi-perspective evaluation framework combining automatic assessment of base-meter conformity, meter-subform adherence, and length control with three LLM judges, blinded human evaluation, and memorization and copying analysis.

Experimental results show that SHAER attains the highest base-meter accuracy among all evaluated systems and achieves high requested-subform adherence. Relative to its untuned foundation model, Yehia-7B, SHAER provides markedly stronger base-meter, meter-subform, and length control. Evaluation with three LLM judges and a blinded human assessment of top-ranked outputs further indicates that these gains in controllability are achieved while retaining competitive semantic and literary quality.