paperbot · PL 论文追踪

全部论文 待读 收藏

P2 ``I Would Have Written My Code Differently': Beginners Struggle to Understand LLM-Generated Code

“我会用不同的方式写代码”:初学者难以理解 LLM 生成的代码
FSE Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering2025匹配度 1/10 · 该论文是计算机教育/HCI 领域的实证研究,关注初学者理解 LLM 生成代码的困难,不涉及静态分析、程序分析、浮点程序分析或贝叶斯程序分析,也不涉及 Agentic 程序或利用 LLM 改进程序分析。引用 5 inbox
Yangtian Zi, Luisa Li, Arjun Guha, Carolyn Anderson, Molly Q Feldman
crossref: 2026-09-12

AI 速览

一句话:实证研究显示初学者理解 LLM 生成代码的单任务成功率仅 32.5%,代码理解是 LLM 辅助编程的关键瓶颈。

LLM 正被越来越多地用于编程工作,已有研究关注提示技巧,但生成后的代码必须被阅读、评估和整合或拒绝,初学者能否胜任这些任务尚不清楚。本文对 32 名 CS1 学生、160 个任务实例开展对照研究,比较他们对自然语言函数描述与 LLM 生成实现的理解,并探究判断代码正确性时的困难。结果显示单任务成功率仅 32.5%,困难在不同人口群体中普遍存在;关键障碍包括非英语母语者的语言壁垒、对 Python 语法不熟悉以及自动化偏见。研究结论表明,代码理解是初学者借助 LLM 写代码时面临的重要屏障。

问题
初学者在使用 LLM 生成代码时,能否理解、评估并正确整合或拒绝这些代码,缺乏实证证据。
方法
对 32 名 CS1 学生、160 个任务实例开展对照研究,比较其对自然语言函数描述与 LLM 生成实现的理解,并分析判断代码正确性时的挑战。
评估
以单任务成功率为指标,发现总体成功率仅 32.5%,各人口群体均普遍困难;关键障碍包括非英语母语者、不熟悉 Python 语法和自动化偏见。
原文摘要(Abstract)

Large language models (LLMs) are being increasingly adopted for programming work. Prior work shows that while LLMs accelerate task completion for professional programmers, beginning programmers struggle to prompt models effectively. However, prompting is just half of the code generation process -- when code is generated, it must be read, evaluated, and integrated (or rejected). How accessible are these tasks for beginning programmers? This paper measures how well beginners comprehend LLM-generated code and explores the challenges students face in judging code correctness. We compare how well students understand natural language descriptions of functions and LLM-generated implementations, studying 32 CS1 students on 160 task instances. Our results show a low per-task success rate of 32.5\%, with indiscriminate struggles across demographic populations. Key challenges include barriers for non-native English speakers, unfamiliarity with Python syntax, and automation bias. Our findings highlight the barrier that code comprehension presents to beginning programmers seeking to write code with LLMs.

链接与引用

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

BibTeX
@inproceedings{paperbot9002,
  title = {``I Would Have Written My Code Differently': Beginners Struggle to Understand LLM-Generated Code},
  author = {Yangtian Zi and Luisa Li and Arjun Guha and Carolyn Anderson and Molly Q Feldman},
  booktitle = {FSE},
  year = {2025},
  doi = {10.1145/3696630.3731663}
}