paperbot · PL 论文追踪

全部论文 待读 收藏

P2 On the Applicability of Language Models to Block-Based Programs

论语言模型在基于块(block-based)程序上的适用性
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 3/10 · 论文属于机器学习与程序语言交叉,但研究对象是 Scratch 积木式教育语言,任务为代码补全与缺陷发现,并非用户核心关注的 Agentic 程序静态分析、LLM/Agent 辅助静态分析与形式化验证,也未涉及浮点或贝叶斯程序分析。引用 12 inbox
Elisabeth Griebl, Benedikt Fein, Florian Obermüller, Gordon Fraser, René Just
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:系统评估 n-gram 与 Transformer 语言模型在 Scratch 积木式程序上的代码补全与缺陷发现可行性,发现积木结构降低可预测性但方法仍可用。

基于块的编程语言(如 Scratch)在编程教育与终端用户编程中日益流行。已有程序分析常借鉴自然语言处理技术,用语言模型对源代码建模,但这类方法所依赖的源代码规律性很大程度上源于文本编程语言强制的语法冗余,而积木式语言恰恰通过移除这些冗余来简化编程,因此语言模型在积木程序上的适用性尚不明确。本文针对流行的积木式语言 Scratch,采用最基础的 n-gram 模型与主流深度学习模型 Transformer 对积木程序建模,并以代码补全和缺陷发现为示例任务进行评估。实验证实,积木结构确实抑制了可预测性,语言模型在积木程序上的表现受到限制,但其使用仍然可行。该研究为改进积木式语言的工具与程序分析奠定了基础。

问题
语言模型建模源代码的可行性在很大程度上依赖文本编程语言的语法冗余,而积木式语言(如 Scratch)刻意移除了这些冗余,因此语言模型在积木程序上的适用性尚不清楚。
方法
作者使用最基础的 n-gram 语言模型和 Transformer 深度学习模型对 Scratch 积木程序进行建模,并在代码补全与缺陷发现两个任务上开展评估。
评估
通过 Scratch 程序上的代码补全与缺陷发现实验,检验语言模型的可预测性与可行性,并与文本编程语言中语言模型的典型表现相对照。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2302-03927,
  title = {On the Applicability of Language Models to Block-Based Programs},
  author = {Elisabeth Griebl and Benedikt Fein and Florian Obermüller and Gordon Fraser and René Just},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00199}
}