大语言模型(LLMs)正日益被视为跨自然语言处理(NLP)任务的通用解决方案,尤其在英语领域。但这一假设是否适用于梵语等低资源、形态丰富的语言?我们通过在梵语诗歌转散文任务上比较指令微调、上下文提示的LLMs与更小的任务特定编码器-解码器模型来解决该问题。该任务具有内在挑战性:梵语诗歌存在自由词序与严格韵律约束的结合,其向规范散文(anvaya,语序重组)的转换需多步推理,涉及复合词分割、依存关系解析和句法线性化,使其成为评估LLMs能否超越专用模型的理想测试平台。对于LLMs,我们在通用模型上应用指令微调,并基于帕尼尼语法和经典注释启发法设计上下文学习模板;对于任务特定建模,我们对ByT5-Sanskrit序列到序列模型进行全微调。实验显示,ByT5-Sanskrit的领域特定微调显著优于所有指令驱动的LLM方法,人工评估强烈证实该结果,分数与肯德尔 tau 系数高度相关;此外,当领域特定诗歌语料不可用时,我们的提示策略为微调提供替代方案,且任务特定序列到序列模型在域外评估中展现出稳健的泛化能力。
英文摘要:
Large Language Models (LLMs) are increasingly treated as universal, general-purpose solutions across NLP tasks, particularly in English. But does this assumption hold for low-resource, morphologically rich languages such as Sanskrit? We address this question by comparing instruction-tuned and in-context-prompted LLMs with smaller task-specific encoder-decoder models on the Sanskrit poetry-to-prose conversion task. This task is intrinsically challenging: Sanskrit verse exhibits free word order combined with rigid metrical constraints, and its conversion to canonical prose (anvaya) requires multi-step reasoning involving compound segmentation, dependency resolution, and syntactic linearisation. This makes it an ideal testbed to evaluate whether LLMs can surpass specialised models. For LLMs, we apply instruction fine-tuning on general-purpose models and design in-context learning templates grounded in Paninian grammar and classical commentary heuristics. For task-specific modelling, we fully fine-tune a ByT5-Sanskrit Seq2Seq model. Our experiments show that domain-specific fine-tuning of ByT5-Sanskrit significantly outperforms all instruction-driven LLM approaches. Human evaluation strongly corroborates this result, with scores exhibiting high correlation with Kendall's Tau scores. Additionally, our prompting strategies provide an alternative to fine-tuning when domain-specific verse corpora are unavailable, and the task-specific Seq2Seq model demonstrates robust generalisation on out-of-domain evaluations.
Adversarial Poetry as a Universal Single-Turn Jailbreak Mechanism in Large Language Models
DEXAI – Icaro Lab(DEXAI–Icaro实验室);Sapienza University of Rome(罗马Sapienza大学);Sant’Anna School of Advanced Studies(Sant’Anna高级研究学校);VU Amsterdam(阿姆斯特丹VU)
Aesthetics of Sanskrit Poetry from the Perspective of Computational Linguistics: A Case Study Analysis on Siksastaka
IIT Kanpur(印度理工学院坎普尔分校);University of Hyderabad(海得拉巴大学);IIT Roorkee(印度理工学院鲁尔基分校);Utah State University(犹他州立大学);IIT Kharagpur(印度理工学院克勒格布尔分校);IIT Mandi(印度理工学院曼迪分校)
本文提出人机协同的可解释计算语言学框架,结合六大梵语诗学派对 Siksastaka 进行多层面标注与分析,并提供 Web 应用支持后续研究。