mlsanityData to 7 Oct 2026

Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generation

arXiv 2407.05437 ↗First posted 7 Jul 2024cs.AIcited by 9

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2022Training language models to follow instructions with human feedbackcited by 15,712
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2021On the Opportunities and Risks of Foundation Modelscited by 3,961
  7. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
  8. 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
  9. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  10. 2021Measuring Coding Challenge Competence With APPScited by 879
  11. 2023Large Language Modelscited by 774
  12. 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 612
13 more
  1. 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
  2. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  3. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  4. 2022Ask Me Anything: A simple strategy for prompting language modelscited by 155
  5. 2022GitHub Copilot AI pair programmer: Asset or Liability?cited by 150
  6. 2023Studying the effect of AI Code Generators on Supporting Novice Learners in Introductory Programmingcited by 87
  7. 2023ChatGPT Prompt Patterns for Improving Code Quality, Refactoring, Requirements Elicitation, and Software Designcited by 66
  8. 2022Is GitHub's Copilot as Bad as Humans at Introducing Vulnerabilities in Code?cited by 63
  9. 2023Effective Test Generation Using Pre-trained Large Language Models and Mutation Testingcited by 51
  10. 2023Computing Education in the Era of Generative AIcited by 50
  11. 2023Exploring the Responses of Large Language Models to Beginner Programmers' Help Requestscited by 44
  12. 2021An Empirical Study on the Usage of BERT Models for Code Completioncited by 22
  13. 2023Testing LLMs on Code Generation with Varying Levels of Prompt Specificitycited by 12

Built on by

Cited by year

Citing papers per year: 2024: 3; 2025: 6.

9 papers.