Exploring the Role of Prompting on Software Quality in Code Generation with Large Language Models
No Thumbnail Available
URL
Journal Title
Journal ISSN
Volume Title
Sähkötekniikan korkeakoulu |
Master's thesis
Authors
Date
2024-05-20
Department
Major/Subject
Human-Computer Interaction
Mcode
SCI3097
Degree programme
CCIS - Master’s Programme in Computer, Communication and Information Sciences (TS2013)
Language
en
Pages
61 + 11
Series
Abstract
Large Language Models (LLMs) and Generative Artificial Intelligence have gained popularity in recent years, due to their proficiency in creating human-like content. They have shown to be formidable tools in many industries, capable of solving tasks and automating processes. Software Engineering (SE) and development is no exception. LLMs can create code and test cases among other deliverables, making them suitable tools in many processes throughout the SE processes and the software development life cycle (SDLC). Therefore, they could decrease the time and effort required to develop software. However, it is unclear how to maximize the code generation performance of LLMs and how input prompts should be constructed to obtain the best quality of code. Here we show that the structure and prompting techniques affect the quality of code generated by the LLMs. We found that the prompt structure, task size, and prompting techniques greatly affect the quality of the generated code. Our study utilized common SE industry-specific quality assurance methods for code quality evaluation, highlighting that there is a spectrum concerning code quality and assessing the performance of LLMs in code generation. Software development and code quality are not pass-fail subjects and therefore this evaluation methodology reflects a more genuine understanding of the performance. Similar methods and techniques can be adapted to new industries and tasks. LLM performance evaluation should take a more holistic approach and closely relate to the working practices used in the industries. We anticipate that the role of prompting increases as the acceptance and potential of LLMs continue to improve. The focus moves from what the models can achieve to how best to utilize these models. LLMs are tools designed to assist us, not solution that solves all our problems and performs all the work for us.Stora språkmodeller och generativ artificiell intelligens har blivit populära teknologier under de senaste åren på grund av deras förmåga att skapa människoliknande innehåll. De har visat sig vara effektiva verktyg i många branscher för att lösa uppgifter och automatisera processer. Programutveckling är inget undantag, då kod är en serie av tecken. Det kan även ses från den stora mängden specialiserade modeller för programutveckling. Stora språkmodeller kan producera kod, testfall och andra slutprodukter, vilket gör dem till lämpliga verktyg i flera mjukvaruutvecklings processer. Därmed kan de minska tiden och ansträngningen som krävs för att utveckla programvara och därmed kostnaderna. Många av dessa tillämpningsområden har blivit studerade, men det är oklart hur stora språkmodellers kodgenereringsförmåga maximeras samt hur prompter ska konstrueras för att uppnå bästa möjliga kodkvalitet. Detta undersökes i detta arbete genom att generera kod till en applikation med stora språkmodeller. Den genererade koden evalueras genom att utnyttja testning av programvara och statisk kod analys som kvalitetssäkrings metoder. De är välkända metoder som används inom mjukvarutekniksindustrin för att evaluera kodkvaliteten. Studien visar att strukturen, uppgiftstorleken och promptteknikerna påverkar kodkvaliteten genererad av stora språkmodeller. Dessutom, de använda evalueringsteknikerna kompletterar varandra och framför att det finns ett spektrum gällande bedömning av kodkvalitet och stora språkmodellers prestanda. Denna evalueringsmetod ger en mer sanningsenlig förståelse av stora språkmodellers prestanda, då programutveckling och kodkvalitet är flexibla ämnen som inte kan evalueras med godkänt/underkänt. Liknande branschspecifika metoder och tekniker kan anpassas till nya branscher och uppgifter. Prestationsutvärdering av stora språkmodeller bör ta ett mer holistiskt tillvägagångssätt och närmare relatera till de arbetsmetoder som används inom branscherna. Promptandes betydelse förväntas att öka i samband med att acceptansen och potentialen för stora språkmodeller fortsätter att utvecklas. Fokus övergår från vad modellerna kan åstadkomma till hur bäst utnyttja dessa modeller. Stora språkmodeller är verktyg konstruerade för att hjälpa oss, inte program som löser alla våra problem och utför allt vårt arbete.Description
Supervisor
Hellas, ArtoThesis advisor
Ala-Kleemola, TimoKeywords
large language models, software engineering, prompt engineering, code generation