arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.09587cs.SE
收藏

关于语言模型在程序生成中的可靠性与可解释性

On the Reliability and Explainability of Language Models for Program Generation

Yue Liu, Chakkrit Tantithamthavorn, Yonghui Liu, Li Li

AI总结:

本文实证研究了八个语言模型在五个数据集上的自动化程序生成能力,发现严重数据重复导致性能被高估,并利用可解释AI揭示模型能识别代码语法但对输入变化鲁棒性有限,为提升评估严谨性提供指导。

摘要:

近期研究采用了预训练语言模型(如 CodeT5 和 CodeGPT)来完成代码生成、修复和翻译等自动化程序生成任务。许多基于语言模型的方法已被提出,并在各种基准数据集上进行了评估,展现出令人期待的性能。然而,这些模型的可靠性仍存在不确定性,特别是它们持续转换代码序列的实际能力。这引发了疑问:这些技术对于自动化程序生成是否足够可信?因此,需要进一步的研究来理解模型逻辑并评估其可靠性与可解释性。为弥补这些研究空白,我们在五个代表性数据集上对八种流行的语言模型进行了彻底的实证研究,以确定自动化程序生成方法的能力与局限。我们进一步采用先进的可解释 AI 方法,突出对代码转换有显著贡献的 token。我们发现,最先进的方法因严重的数据重复导致了不恰当的性能评估,从而产生了过于乐观的结果。我们的可解释性分析表明,在各种实验场景中,语言模型能够识别代码语法和结构信息,但对输入序列的变化表现出有限的鲁棒性。总体而言,未来提升自动化程序生成的可靠性与可解释性,更严谨的评估方法和基准至关重要。我们的发现为这一目标提供了重要指南。

英文摘要:

Recent studies have adopted pre-trained language models, such as CodeT5 and CodeGPT, for automated program generation tasks like code generation, repair, and translation. Numerous language model-based approaches have been proposed and evaluated on various benchmark datasets, demonstrating promising performance. However, there is still uncertainty about the reliability of these models, particularly their realistic ability to consistently transform code sequences. This raises the question: are these techniques sufficiently trustworthy for automated program generation? Consequently, Further research is needed to understand model logic and assess reliability and explainability. To bridge these research gaps, we conduct a thorough empirical study of eight popular language models on five representative datasets to determine the capabilities and limitations of automated program generation approaches. We further employ advanced explainable AI approaches to highlight the tokens that significantly contribute to the code transformation. We discover that state-of-the-art approaches suffer from inappropriate performance evaluation stemming from severe data duplication, causing over-optimistic results. Our explainability analysis reveals that, in various experimental scenarios, language models can recognize code grammar and structural information, but they exhibit limited robustness to changes in input sequences. Overall, more rigorous evaluation approaches and benchmarks are critical to enhance the reliability and explainability of automated program generation moving forward. Our findings provide important guidelines for this goal.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑