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

探索AI辅助代码生成中的提示模式:迈向更快、更高效的开发者-AI协作

Exploring Prompt Patterns in AI-Assisted Code Generation: Towards Faster and More Effective Developer-AI Collaboration

Sophia DiCuffa, Amanda Zambrana, Priyanshi Yadav, Sashidhar Madiraju, Khushi Suman, Eman Abdullah AlOmar

AI总结:

本文基于DevGPT数据集分析七种提示模式,发现“上下文与指令”和“配方”模式能以最少迭代获得高质量代码,为优化开发者与AI协作的提示工程提供实用指导。

摘要:

AI工具在软件开发中的日益集成,特别是像ChatGPT这样的大语言模型(LLMs),已经彻底改变了开发者处理编码任务的方式。然而,获得高质量代码通常需要迭代交互,这可能耗时且效率低下。本文探索了结构化提示模式的应用,以最小化实现令人满意的AI辅助代码生成所需的交互次数。利用DevGPT数据集,我们分析了七种不同的提示模式,以评估它们在减少开发者与AI之间来回沟通方面的有效性。我们的研究结果突出表明,诸如“上下文与指令”和“配方”等模式在实现高质量输出且迭代次数最少方面尤为有效。该研究强调了提示工程在简化开发者-AI协作方面的潜力,为构建在精确性、效率和清晰度之间取得平衡的提示提供了实用见解。

英文摘要:

The growing integration of AI tools in software development, particularly Large Language Models (LLMs) such as ChatGPT, has revolutionized how developers approach coding tasks. However, achieving high-quality code often requires iterative interactions, which can be time-consuming and inefficient. This paper explores the application of structured prompt patterns to minimize the number of interactions required for satisfactory AI-assisted code generation. Using the DevGPT dataset, we analyzed seven distinct prompt patterns to evaluate their effectiveness in reducing back-and-forth communication between developers and AI. Our findings highlight patterns such as ''Context and Instruction'' and ''Recipe'' as particularly effective in achieving high-quality outputs with minimal iterations. The study emphasizes the potential for prompt engineering to streamline developer-AI collaboration, providing practical insights into crafting prompts that balance precision, efficiency, and clarity.

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

↑