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

论语言模型在基于块的程序中的适用性

On the Applicability of Language Models to Block-Based Programs

Elisabeth Griebl, Benedikt Fein, Florian Obermüller, Gordon Fraser, René Just

AI总结:

本文探究语言模型对基于块的编程语言(如Scratch)的适用性,通过n-gram模型和transformers建模,在代码补全和错误发现任务上验证可行性,为改进相关工具和分析奠定基础。

摘要:

像Scratch这样的基于块的编程语言在编程教育和最终用户编程中越来越受欢迎。最近的程序分析建立在源代码可以使用自然语言处理技术进行建模这一见解之上。支持这种方法的源代码的许多规律性是由于文本编程语言所施加的语法开销。然而,这种语法开销正是基于块的语言为了简化编程而移除的。因此,尚不清楚这种建模方法在基于块的编程语言上表现如何。在本文中,我们研究了语言模型对流行的基于块的编程语言Scratch的适用性。我们使用n-gram模型(最基本的语言模型类型)和transformers(一种流行的深度学习模型)对Scratch程序进行建模。在代码补全和错误发现这两个示例任务上的评估证实,块会阻碍可预测性,但使用语言模型仍然是可行的。我们的发现为改进基于块的语言的工具和分析奠定了基础。

英文摘要:

Block-based programming languages like Scratch are increasingly popular for programming education and end-user programming. Recent program analyses build on the insight that source code can be modelled using techniques from natural language processing. Many of the regularities of source code that support this approach are due to the syntactic overhead imposed by textual programming languages. This syntactic overhead, however, is precisely what block-based languages remove in order to simplify programming. Consequently, it is unclear how well this modelling approach performs on block-based programming languages. In this paper, we investigate the applicability of language models for the popular block-based programming language Scratch. We model Scratch programs using n-gram models, the most essential type of language model, and transformers, a popular deep learning model. Evaluation on the example tasks of code completion and bug finding confirm that blocks inhibit predictability, but the use of language models is nevertheless feasible. Our findings serve as foundation for improving tooling and analyses for block-based languages.

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

↑