Text Generation has achieved remarkable performance using large language models. It has also been recently well-studied that these large language models are capable of creative generation tasks but prominently for high-resource languages. This prompts a fundamental question: Is there a way to utilize these (large) language models for structured poetry generation in a low-resource language, such as Sanskrit? We present Chandomitra, an English input to structured Sanskrit Poetry translation dataset, specifically adhering to the Anushtubh meter. We benchmark various open and closed models, and scrutinize specialized techniques such as constrained decoding and instruction fine-tuning, for the proposed task. Our constrained decoding methodology achieves 99.86% syntactic accuracy in generating metrically valid Sanskrit poetry, outperforming GPT-4o (1-shot: 31.24%). Our best-performing instruction-tuned model, on the other hand, performs better in semantic coherence with the English input, at the expense of slightly lower syntactic accuracy. Human evaluation further reveals that instruction fine-tuned model is better able to capture the poetic aspects. Data and Code are available.
翻译:文本生成领域利用大型语言模型已取得显著成就。近期研究充分证明,这些大型语言模型具备创造性生成能力,但主要集中于高资源语言。这引出一个根本性问题:能否利用这些(大型)语言模型为低资源语言(如梵语)生成结构化诗歌?本文提出Chandomitra——一个从英语输入到结构化梵文诗歌的翻译数据集,严格遵循Anushtubh韵律规范。我们针对该任务对多种开源与闭源模型进行基准测试,并深入探究约束解码和指令微调等专项技术。我们的约束解码方法在生成符合韵律的梵文诗歌时实现了99.86%的句法准确率,显著优于GPT-4o(单样本:31.24%)。另一方面,我们性能最优的指令微调模型在语义连贯性方面表现更佳,但句法准确率略有降低。人工评估进一步表明,指令微调模型能更好地捕捉诗歌的艺术特质。本研究的代码与数据均已公开。