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

在函数式编程课程背景下评估LLM:一项全面研究

Evaluating LLMs in the Context of a Functional Programming Course: A Comprehensive Study

McGill University(麦吉尔大学);University of Toronto(多伦多大学)

Yihan Zhang, Brigitte Pientka, Xujie Si

AI总结:

本文评估了LLM在函数式编程课程中的有效性,通过构建三个基准测试,发现LLM在纠正语法和类型错误及回答基础概念问题方面表现良好,但解决低资源环境下家庭作业问题的能力较弱。

摘要:

大型语言模型(LLM)正在改变学习者在课堂外获取知识的方式。先前的研究表明,LLM在使用高资源编程语言如Java或Python的入门计算机科学课程中,似乎在生成简短和简单的问题方面是有效的。在本文中,我们评估了在低资源编程语言——OCaml的教育环境下LLM的有效性。特别是,我们构建了三个基准测试,以全面评估9种最先进的LLM:1)$λ$CodeGen(包含自然语言家庭作业编程问题的基准);2)$λ$Repair(包含从实际学生提交中提取的语法、类型和逻辑错误的程序);3)$λ$Explain(包含关于理论编程概念的自然语言问题的基准)。我们使用OCaml编译器和自动评分器对每个LLM的响应进行正确性评分。我们的评估超越了常见的评估方法,通过手动评分来评估响应的质量。我们的研究显示,前三种LLM在典型函数式编程课程的所有任务中都是有效的,尽管它们在低资源环境下解决的家庭作业问题数量远少于在Python和Java入门编程问题上的成功。LLM的优势在于纠正语法和类型错误以及生成基本概念性问题的答案。虽然LLM在某些领域可能尚未匹配专门针对语言的工具,但其作为多编程语言一站式工具的便利性可能超过更专门化系统的益处。我们希望我们的基准测试可以服务于多个目的:评估LLM的演变能力,帮助教师提高学生对LLM生成解决方案局限性的意识,并告知编程语言研究人员关于如何将领域特定推理整合到LLM中,以及开发更强大的代码合成和修复工具以适应低资源语言。

英文摘要:

Large-Language Models (LLMs) are changing the way learners acquire knowledge outside the classroom setting. Previous studies have shown that LLMs seem effective in generating to short and simple questions in introductory CS courses using high-resource programming languages such as Java or Python. In this paper, we evaluate the effectiveness of LLMs in the context of a low-resource programming language -- OCaml, in an educational setting. In particular, we built three benchmarks to comprehensively evaluate 9 state-of-the-art LLMs: 1) $λ$CodeGen (a benchmark containing natural-language homework programming problems); 2) $λ$Repair (a benchmark containing programs with syntax, type, and logical errors drawn from actual student submissions); 3) $λ$Explain (a benchmark containing natural language questions regarding theoretical programming concepts). We grade each LLMs responses with respect to correctness using the OCaml compiler and an autograder. And our evaluation goes beyond common evaluation methodology by using manual grading to assess the quality of the responses. Our study shows that the top three LLMs are effective on all tasks within a typical functional programming course, although they solve much fewer homework problems in the low-resource setting compared to their success on introductory programming problems in Python and Java. The strength of LLMs lies in correcting syntax and type errors as well as generating answers to basic conceptual questions. While LLMs may not yet match dedicated language-specific tools in some areas, their convenience as a one-stop tool for multiple programming languages can outweigh the benefits of more specialized systems. We hope our benchmarks can serve multiple purposes: to assess the evolving capabilities of LLMs, to help instructors raise awareness among students about the limitations of LLM-generated solutions, and to inform programming language researchers about opportunities to integrate domain-specific reasoning into LLMs and develop more powerful code synthesis and repair tools for low-resource languages.

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

↑