大型语言模型(LLMs)在自动化繁琐的开发任务(如创建和维护代码文档)方面具有巨大潜力。然而,开发者在多大程度上能有效地提示LLMs以生成简洁且有用的文档尚不清楚。我们报告了一项受控实验,涉及20名专业人士和30名计算机科学学生,任务是为两个Python函数生成代码文档。实验组在Visual Studio Code的类ChatGPT扩展中自由输入临时提示,而对照组执行预定义的少样本提示。我们的结果显示,专业人士和学生不知道或无法应用提示工程技术。尤其是学生认为,与准备好的提示生成的文档相比,临时提示生成的文档可读性显著较差、不够简洁且帮助性较低。一些专业人士仅通过在临时提示中包含关键词Docstring就生成了更高质量的文档。虽然学生希望在制定提示时获得更多支持,但专业人士则欣赏临时提示的灵活性。两组参与者很少将输出评估为完美。相反,他们将工具理解为迭代改进文档的支持。需要进一步研究以了解开发者具有哪些提示技能和偏好,以及他们在特定任务中需要哪些支持。
英文摘要:
Large language models (LLMs) bear great potential for automating tedious development tasks such as creating and maintaining code documentation. However, it is unclear to what extent developers can effectively prompt LLMs to create concise and useful documentation. We report on a controlled experiment with 20 professionals and 30 computer science students tasked with code documentation generation for two Python functions. The experimental group freely entered ad-hoc prompts in a ChatGPT-like extension of Visual Studio Code, while the control group executed a predefined few-shot prompt. Our results reveal that professionals and students were unaware of or unable to apply prompt engineering techniques. Especially students perceived the documentation produced from ad-hoc prompts as significantly less readable, less concise, and less helpful than documentation from prepared prompts. Some professionals produced higher quality documentation by just including the keyword Docstring in their ad-hoc prompts. While students desired more support in formulating prompts, professionals appreciated the flexibility of ad-hoc prompting. Participants in both groups rarely assessed the output as perfect. Instead, they understood the tools as support to iteratively refine the documentation. Further research is needed to understand which prompting skills and preferences developers have and which support they need for certain tasks.
Free and Customizable Code Documentation with LLMs: A Fine-Tuning Approach
Department of Computer Science and Engineering(计算机科学与工程系);Northwestern University(西北大学);School of Electrical & Computer Engineering(电气与计算机工程学院);Purdue University(普渡大学)
Query2Diagram: Answering Developer Queries with UML Diagrams
HSE University(俄罗斯高等经济学院);St. Petersburg Department of Steklov Mathematical Institute, RAS(圣彼得堡斯捷克洛夫数学研究所(俄罗斯科学院));St. Petersburg State University(圣彼得堡国立大学)
LLARS: Enabling Domain Expert & Developer Collaboration for LLM Prompting, Generation and Evaluation
Technische Hochschule Nürnberg Georg Simon Ohm(图恩-努尔堡技术大学乔治·西蒙·奥姆学院);Faculty of Computer Science, Centre for Artificial Intelligence (KIZ)(计算机科学学院,人工智能中心(KIZ));Faculty of Social Sciences, Institute for E-Counselling(社会科学学院,电子咨询研究所)
Precision in Practice: Knowledge Guided Code Summarizing Grounded in Industrial Expectations
School of Computer Science, Wuhan University, China(武汉大学计算机科学学院);Department of Computer Science and Engineering, The Hong Kong University of Science and Technology, China(香港科学与技术大学计算机科学与工程系);Department of Computer Science(计算机科学系)
Using Large Language Models to Enrich the Documentation of Datasets for Machine Learning
Internet Interdisciplinary Institute (IN3), Universitat Oberta de Catalunya (UOC)(开放加泰罗尼亚大学互联网跨学科研究所);Luxembourg Institute of Science and Technology(卢森堡科学技术研究院);University of Luxembourg(卢森堡大学)