The rapid advancements in large language models (LLMs) have greatly expanded the potential for automated code-related tasks. Two primary methodologies are used in this domain: prompt engineering and fine-tuning. Prompt engineering involves applying different strategies to query LLMs, like ChatGPT, while fine-tuning further adapts pre-trained models, such as CodeBERT, by training them on task-specific data. Despite the growth in the area, there remains a lack of comprehensive comparative analysis between the approaches for code models. In this paper, we evaluate GPT-4 using three prompt engineering strategies -- basic prompting, in-context learning, and task-specific prompting -- and compare it against 17 fine-tuned models across three code-related tasks: code summarization, generation, and translation. Our results indicate that GPT-4 with prompt engineering does not consistently outperform fine-tuned models. For instance, in code generation, GPT-4 is outperformed by fine-tuned models by 28.3% points on the MBPP dataset. It also shows mixed results for code translation tasks. Additionally, a user study was conducted involving 27 graduate students and 10 industry practitioners. The study revealed that GPT-4 with conversational prompts, incorporating human feedback during interaction, significantly improved performance compared to automated prompting. Participants often provided explicit instructions or added context during these interactions. These findings suggest that GPT-4 with conversational prompting holds significant promise for automated code-related tasks, whereas fully automated prompt engineering without human involvement still requires further investigation.
From Prompting to Engineering: A Research Agenda for Prompt Engineering in Software Engineering
Universitat Politècnica de Catalunya(加泰罗尼亚理工大学);CNR(意大利国家研究委员会);Pegaso University(佩加索大学);University of Gothenburg and Chalmers University of Technology(哥德堡大学与查尔姆斯理工大学);Politecnico di Torino(都灵理工大学);University of Glasgow(格拉斯哥大学);Tampere University(坦佩雷大学)
Large Language Models in Thematic Analysis: Prompt Engineering, Evaluation, and Guidelines for Qualitative Software Engineering Research
Chalmers University of Technology(查尔姆斯理工大学);University of Gothenburg(哥德堡大学);Universidad Ramon Llull(拉蒙·鲁尔大学);Uppsala University(乌普萨拉大学);University of Hohenheim(霍恩海姆大学)
TraceLLM: Leveraging Large Language Models with Prompt Engineering for Enhanced Requirements Traceability
KFUPM(国王法赫德石油矿物大学);Imam Abdulrahman Bin Faisal University(伊玛目阿卜杜勒拉赫曼·本·费萨尔大学);SDAIA–KFUPM Joint Research Center of Artificial Intelligence, KFUPM(沙特数据与人工智能中心-国王法赫德石油矿物大学人工智能联合研究中心);University of Quebec in Montreal(蒙特利尔魁北克大学)
Hybrid Active Teaching Methodology for Learning Development: A Self-assessment Case Study Report in Computer Engineering
University of Luxembourg(卢森堡大学);Instituto Superior Manuel Teixeira Gomes(曼努埃尔·特谢拉·戈梅斯高等学院);Lusófona University(卢索福纳大学);Universidad Nacional de Rosario(罗萨里奥国立大学)
When Prompt Engineering Meets Software Engineering: CNL-P as Natural and Robust "APIs'' for Human-AI Interaction
CSIRO’s Data61(CSIRO数据61实验室);Jiangxi Provincial Key Laboratory for High Performance Computing(江西省高性能计算重点实验室);State International Science & Technology Cooperation Base of Networked Supporting Software(网络化支持软件国际科技合作基地);Language Intelligence Research Center(语言智能研究中心);Jiangxi Normal University(江西师范大学);Institute of AI, Newcastle University, UK(人工智能研究院,新castle大学,英国);UGAiForge
Prompt Engineering Strategies for LLM-based Qualitative Coding of Psychological Safety in Software Engineering Communities: A Controlled Empirical Study
Federal University of Bahia(巴伊亚联邦大学);State University of Feira de Santana(费拉德桑塔纳州立大学);Federal University of Sergipe(塞格皮联邦大学);Federal Institute of Ceara(塞阿拉联邦理工学院)
Jailbreaking ChatGPT via Prompt Engineering: An Empirical Study
Nanyang Technological University(南洋理工大学);University of New South Wales(新南威尔士大学);Virginia Tech(弗吉尼亚理工大学);Huazhong University of Science and Technology(华中科技大学)