Leveraging LLMs for code generation is becoming increasingly common, as tools like ChatGPT can suggest method implementations with minimal input, such as a method signature and brief description. Empirical studies further highlight the effectiveness of LLMs in handling such tasks, demonstrating notable performance in code generation scenarios. However, LLMs are inherently non-deterministic, with their output influenced by parameters such as temperature, which regulates the model's level of creativity, and top-p, which controls the choice of the tokens that shall appear in the output. Despite their significance, the role of these parameters is often overlooked. This paper systematically studies the impact of these parameters, as well as the number of prompt repetitions required to account for non-determinism, in the context of 548 Java methods. We observe significantly different performances across different configurations of ChatGPT, with temperature having a marginal impact compared to the more prominent influence of the top-p parameter. Additionally, we show how creativity can enhance code generation tasks. Finally, we provide concrete recommendations for addressing the non-determinism of the model.
Unveiling the Role of ChatGPT in Software Development: Insights from Developer-ChatGPT Interactions on GitHub
School of Computer Science, Wuhan University(武汉大学计算机学院);Nanyang Technological University(南洋理工大学);School of Computer Science, Central China Normal University(华中师范大学计算机学院)
Jailbreaking ChatGPT via Prompt Engineering: An Empirical Study
Nanyang Technological University(南洋理工大学);University of New South Wales(新南威尔士大学);Virginia Tech(弗吉尼亚理工大学);Huazhong University of Science and Technology(华中科技大学)
"Always Nice and Confident, Sometimes Wrong": Developer's Experiences Engaging Large Language Models (LLMs) Versus Human-Powered Q&A Platforms for Coding Support
Using LLMs in Software Design: An Empirical Study of GitHub and A Practitioner Survey
School of Computer Science, Wuhan University(武汉大学计算机学院);School of Computer Science, Central China Normal University(中央财经大学计算机学院);School of Computing Technologies, RMIT University(皇家墨尔本理工大学计算技术学院);M3S Research Unit, University of Oulu(奥卢大学M3S研究单位);School of Computer Science, Nanjing University of Science(南京理工大学计算机学院)