Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generation
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) and prompt engineering hold significant potential for advancing computer programming education through personalized instruction. This paper explores this potential by investigating three critical research questions: the systematic categorization of prompt engineering strategies tailored to diverse educational needs, the empowerment of LLMs to solve complex problems beyond their inherent capabilities, and the establishment of a robust framework for evaluating and implementing these strategies. Our methodology involves categorizing programming questions based on educational requirements, applying various prompt engineering strategies, and assessing the effectiveness of LLM-generated responses. Experiments with GPT-4, GPT-4o, Llama3-8b, and Mixtral-8x7b models on datasets such as LeetCode and USACO reveal that GPT-4o consistently outperforms others, particularly with the "multi-step" prompt strategy. The results show that tailored prompt strategies significantly enhance LLM performance, with specific strategies recommended for foundational learning, competition preparation, and advanced problem-solving. This study underscores the crucial role of prompt engineering in maximizing the educational benefits of LLMs. By systematically categorizing and testing these strategies, we provide a comprehensive framework for both educators and students to optimize LLM-based learning experiences. Future research should focus on refining these strategies and addressing current LLM limitations to further enhance educational outcomes in computer programming instruction.
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 25 of its 37 references that are in the map. First posted on arXiv 7 Jul 2024.
Builds on
25 of 37 references.
References · 25
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021On the Opportunities and Risks of Foundation Modelscited by 3,961
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2023Large Language Modelscited by 774
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 612
13 more
- 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022Ask Me Anything: A simple strategy for prompting language modelscited by 155
- 2022GitHub Copilot AI pair programmer: Asset or Liability?cited by 150
- 2023Studying the effect of AI Code Generators on Supporting Novice Learners in Introductory Programmingcited by 87
- 2023ChatGPT Prompt Patterns for Improving Code Quality, Refactoring, Requirements Elicitation, and Software Designcited by 66
- 2022Is GitHub's Copilot as Bad as Humans at Introducing Vulnerabilities in Code?cited by 63
- 2023Effective Test Generation Using Pre-trained Large Language Models and Mutation Testingcited by 51
- 2023Computing Education in the Era of Generative AIcited by 50
- 2023Exploring the Responses of Large Language Models to Beginner Programmers' Help Requestscited by 44
- 2021An Empirical Study on the Usage of BERT Models for Code Completioncited by 22
- 2023Testing LLMs on Code Generation with Varying Levels of Prompt Specificitycited by 12
Built on by
Citing papers per year: 2024: 3; 2025: 6.
9 papers.
- 2025EduBench: A Comprehensive Benchmarking Dataset for Evaluating Large Language Models in Diverse Educational Scenarioscited by 16
- 2024The Sociolinguistic Foundations of Language Modelingcited by 13
- 2024The Impact of Prompt Programming on Function-Level Code Generationcited by 13
- 2024Code Generation and Algorithmic Problem Solving Using Llama 3.1 405Bcited by 7
- 2025Integrating Expert Knowledge into Logical Programs via LLMscited by 3
- 2025Unlocking the Potential of Past Research: Using Generative AI to Reconstruct Healthcare Simulation Modelscited by 2
- 2025Can LLMs Replace Humans During Code Chunking?cited by 2
- 2025Hyperbolic Large Language Modelscited by 2
- 2025PCEval: A Benchmark for Evaluating Physical Computing Capabilities of Large Language Modelscited by 0
- 2025PCEval: A Benchmark for Evaluating Physical Computing Capabilities of Large Language Models31 Dec 2025
- 2025Hyperbolic Large Language Models6 Sep 2025
- 2025Can LLMs Replace Humans During Code Chunking?24 Jun 2025
- 2025EduBench: A Comprehensive Benchmarking Dataset for Evaluating Large Language Models in Diverse Educational Scenarios22 May 2025
- 2025Unlocking the Potential of Past Research: Using Generative AI to Reconstruct Healthcare Simulation Models27 Mar 2025
- 2025Integrating Expert Knowledge into Logical Programs via LLMs17 Feb 2025
- 2024The Impact of Prompt Programming on Function-Level Code Generation29 Dec 2024
- 2024Code Generation and Algorithmic Problem Solving Using Llama 3.1 405B26 Sep 2024
- 2024The Sociolinguistic Foundations of Language Modeling12 Jul 2024