Thai verse generator matches human style in sound and form
Single-Sample Decoding of a Two-Layer Sound-Word Canvas Model for Thai Klon Pad
Artificial Intelligence
Summary
The authors developed a computer program that creates traditional Thai verse called klon pad. It uses two layers—one controlling the sound and rhyme, the other controlling whole words—to generate poetry that closely follows human-written examples. When tested on new topics, the program's poems passed strict quality checks almost as often as real human poems. The model’s careful sampling keeps errors low but reduces word variety compared to humans. This system outperforms previous public Thai verse generators by a large margin.
What this means in practice
- •For language technology developers: Generate Thai poetry with high adherence to traditional form and sound constraints for creative applications and automated content generation.
- •For natural language processing engineers: Use the two-layer masking and decoding approach to improve control over rhythmic and lexical features in low-resource poetic text generation tasks.
Authors
Worasait Suwannik
Abstract
We present a generator of Thai klon pad verse, one stanza from a short topic, and evaluate it against human verse on held-out topics. The generator is a masked language model initialised from WangchanBERTa over a fixed canvas with two layers: a sound layer of pronounced syllables, where rhyme, tone and syllable count are enforced as hard masks, and a word layer of whole words, so that no word is cut into written pieces. Decoding commits one cell at a time and samples at temperature 0.4; one sample is drawn per topic, with no selection, reranking or repair. On 78 held-out topics never used in development, judged by three independent runs of a frozen LLM judge in the same pools as the human stanzas from which the topics were written, 70.5% of the generated stanzas pass form, lexical cleanness of all four lines and topic alignment together, against 76.9% for the human stanzas (difference -6.4 points, 95% CI [-19.2, +6.4]). Cleanness is level with human (85.9% vs. 87.2%), and the stanzas pass form and cleanness together slightly more often than the human ones (+3.8 points, [-6.4, +14.1]); the difference lies in alignment (84.6% vs. 91.0%), on topics that were written from the human stanzas. The low temperature matters: at higher temperatures the same model passes clearly fewer of the same topics, because lexical errors lie in the model's lower-probability choices; sharpening the sampling distribution removes most of them, at a cost in vocabulary (7.5% rare words against 16.5% in the human stanzas) and diversity. The pre-registered target, all-three within 5 points of human, is missed by 1.4 points. KlonSuphap-LM, the only public klon pad generator we know of, passes none of the 78 held-out topics when judged in separate pools together with the method's and the human stanzas (form 19.2%, cleanness 3.8%).