Prompt Engineering or Fine-Tuning: An Empirical Assessment of LLMs for Code
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). First posted on arXiv 11 Oct 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 1; 2025: 2; 2026: 6.
9 papers.
- 2025Agent READMEs: An Empirical Study of Context Files for Agentic Codingcited by 23
- 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generationcited by 9
- 2026MultiBreak: A Scalable and Diverse Multi-turn Jailbreak Benchmark for Evaluating LLM Safetycited by 8
- 2024Synergizing LLMs and Knowledge Graphs: A Novel Approach to Software Repository-Related Question Answeringcited by 1
- 2026Leveraging LLMs to support co-evolution between definitions and instances of textual DSLs: A Systematic Evaluationcited by 1
- 2026Can AI Agents Generate Microservices? How Far are We?cited by 1
- 2026From Instruction to Output: The Role of Prompting in Modern NLGcited by 0
- 2026OMEGA: Optimizing Machine Learning by Evaluating Generated Algorithmscited by 0
- 2026Comparing Large Language Models on Scrum Certification-Style Questions: Accuracy, Stability, and Error Patternscited by 0
- 2026Comparing Large Language Models on Scrum Certification-Style Questions: Accuracy, Stability, and Error Patterns29 Jun 2026
- 2026MultiBreak: A Scalable and Diverse Multi-turn Jailbreak Benchmark for Evaluating LLM Safety3 May 2026
- 2026OMEGA: Optimizing Machine Learning by Evaluating Generated Algorithms29 Apr 2026
- 2026Can AI Agents Generate Microservices? How Far are We?9 Mar 2026
- 2026Leveraging LLMs to support co-evolution between definitions and instances of textual DSLs: A Systematic Evaluation12 Feb 2026
- 2026From Instruction to Output: The Role of Prompting in Modern NLG21 Jan 2026
- 2025Agent READMEs: An Empirical Study of Context Files for Agentic Coding17 Nov 2025
- 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generation3 Jun 2025
- 2024Synergizing LLMs and Knowledge Graphs: A Novel Approach to Software Repository-Related Question Answering5 Dec 2024