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

基于自然语言模型的新手类型错误诊断

Novice Type Error Diagnosis with Natural Language Models

McGill University(麦吉尔大学);Mila - Quebec Institute(米拉-魁北克研究所)

Chuqin Geng, Haolin Ye, Yixuan Li, Tianyu Han, Brigitte Pientka, Xujie Si

摘要:

强静态类型系统帮助程序员消除许多错误,而无需提供类型注释。然而,这种灵活性使得诊断错误类型的程序变得非常重要,特别是对于新手程序员。与经典的约束求解和基于优化的方法相比,数据驱动的方法在以更高的精度识别类型错误的根本原因方面表现出了很大的潜力。这项工作不依赖于手工设计的功能,而是探索用于类型错误定位的自然语言模型,该模型可以以端到端的方式进行训练,而不需要任何功能。我们证明,对于新手类型错误诊断,语言模型为基础的方法显着优于以前的国家的最先进的数据驱动的方法。具体来说,我们的模型可以在62%的时间内正确预测类型错误,在更严格的准确性指标中,比最先进的Nate数据驱动模型高出11%。此外,我们还使用结构探针来解释不同语言模型之间的性能差异。

英文摘要:

Strong static type systems help programmers eliminate many errors without much burden of supplying type annotations. However, this flexibility makes it highly non-trivial to diagnose ill-typed programs, especially for novice programmers. Compared to classic constraint solving and optimization-based approaches, the data-driven approach has shown great promise in identifying the root causes of type errors with higher accuracy. Instead of relying on hand-engineered features, this work explores natural language models for type error localization, which can be trained in an end-to-end fashion without requiring any features. We demonstrate that, for novice type error diagnosis, the language model-based approach significantly outperforms the previous state-of-the-art data-driven approach. Specifically, our model could predict type errors correctly 62% of the time, outperforming the state-of-the-art Nate's data-driven model by 11%, in a more rigorous accuracy metric. Furthermore, we also apply structural probes to explain the performance difference between different language models.

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

↑