Testing LLMs on Code Generation with Varying Levels of Prompt Specificity
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 5 of its 10 references that are in the map. First posted on arXiv 10 Nov 2023.
Builds on
5 of 10 references.
References · 5
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2022Prompting GPT-3 To Be Reliablecited by 258
- 2022Large Language Models Meet NL2Code: A Surveycited by 135
- 2022Conversing with Copilot: Exploring Prompt Engineering for Solving CS1 Problems Using Natural Languagecited by 81
Built on by
Citing papers per year: 2024: 3; 2025: 8; 2026: 1.
12 papers.
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 52
- 2025Benchmarking Prompt Sensitivity in Large Language Modelscited by 38
- 2024Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generationcited by 9
- 2024Tabular Embedding Model (TEM): Finetuning Embedding Models For Tabular RAG Applicationscited by 8
- 2025Tests as Prompt: A Test-Driven-Development Benchmark for LLM Code Generationcited by 5
- 2025Why is prompting hard? Understanding prompts on binary sequence predictorscited by 4
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generationcited by 4
- 2025LOCOFY Large Design Models -- Design to code conversion solutioncited by 0
- 2025Iterative Learning of Computable Phenotypes for Treatment Resistant Hypertension using Large Language Modelscited by 0
- 2025Estimating the Error of Large Language Models at Pairwise Text Comparisoncited by 0
- 2025Lifecycle-Aware code generation: Leveraging Software Engineering Phases in LLMscited by 0
- 2026Large Language Models for Code Generation from Multilingual Prompts: A Curated Benchmark and a Study on Code Qualitycited by 0
- 2026Large Language Models for Code Generation from Multilingual Prompts: A Curated Benchmark and a Study on Code Quality16 Jul 2026
- 2025Lifecycle-Aware code generation: Leveraging Software Engineering Phases in LLMs28 Oct 2025
- 2025Estimating the Error of Large Language Models at Pairwise Text Comparison25 Oct 2025
- 2025Iterative Learning of Computable Phenotypes for Treatment Resistant Hypertension using Large Language Models7 Aug 2025
- 2025LOCOFY Large Design Models -- Design to code conversion solution22 Jul 2025
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generation11 Jun 2025
- 2025Tests as Prompt: A Test-Driven-Development Benchmark for LLM Code Generation13 May 2025
- 2025Why is prompting hard? Understanding prompts on binary sequence predictors15 Feb 2025
- 2025Benchmarking Prompt Sensitivity in Large Language Models9 Feb 2025
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Study8 Jul 2024
- 2024Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generation7 Jul 2024
- 2024Tabular Embedding Model (TEM): Finetuning Embedding Models For Tabular RAG Applications28 Apr 2024