Testing LLMs on Code Generation with Varying Levels of Prompt Specificity

Lincoln Murr, Morgan Grainger, David Gao
11/10/2023
cs.SEcs.AI

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Large language models (LLMs) have demonstrated unparalleled prowess in mimicking human-like text generation and processing. Among the myriad of applications that benefit from LLMs, automated code generation is increasingly promising. The potential to transform natural language prompts into executable code promises a major shift in software development practices and paves the way for significant reductions in manual coding efforts and the likelihood of human-induced errors. This paper reports the results of a study that evaluates the performance of various LLMs, such as Bard, ChatGPT-3.5, ChatGPT-4, and Claude-2, in generating Python for coding problems. We focus on how levels of prompt specificity impact the accuracy, time efficiency, and space efficiency of the generated code. A benchmark of 104 coding problems, each with four types of prompts with varying degrees of tests and specificity, was employed to examine these aspects comprehensively. Our results indicate significant variations in performance across different LLMs and prompt types, and its key contribution is to reveal the ideal prompting strategy for creating accurate Python functions. This study lays the groundwork for further research in LLM capabilities and suggests practical implications for utilizing LLMs in automated code generation tasks and test-driven development.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{murr2023testing,
  title  = {Testing LLMs on Code Generation with Varying Levels of Prompt Specificity},
  author = {Lincoln Murr and Morgan Grainger and David Gao},
  year   = {2023},
  eprint = {2311.07599},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.07599v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.07599.svg)](https://codeofpaper.com/paper/2311.07599)

Discussion