[Paper Review] Conversing with Copilot: Exploring Prompt Engineering for Solving CS1 Problems Using Natural Language
This study evaluates GitHub Copilot's performance on 166 CS1 programming problems, finding that 50% are solved on the first try using original prompts, and 60% of the remaining 50% are resolved through natural language prompt engineering. The results suggest that prompt engineering—refining problem descriptions with algorithmic hints—is a highly effective, pedagogically valuable interaction that fosters computational thinking in introductory programming education.
GitHub Copilot is an artificial intelligence model for automatically generating source code from natural language problem descriptions. Since June 2022, Copilot has officially been available for free to all students as a plug-in to development environments like Visual Studio Code. Prior work exploring OpenAI Codex, the underlying model that powers Copilot, has shown it performs well on typical CS1 problems thus raising concerns about the impact it will have on how introductory programming courses are taught. However, little is known about the types of problems for which Copilot does not perform well, or about the natural language interactions that a student might have with Copilot when resolving errors. We explore these questions by evaluating the performance of Copilot on a publicly available dataset of 166 programming problems. We find that it successfully solves around half of these problems on its very first attempt, and that it solves 60\% of the remaining problems using only natural language changes to the problem description. We argue that this type of prompt engineering, which we believe will become a standard interaction between human and Copilot when it initially fails, is a potentially useful learning activity that promotes computational thinking skills, and is likely to change the nature of code writing skill development.
Motivation & Objective
- To assess how well GitHub Copilot solves introductory programming problems using only natural language prompts.
- To investigate whether modifying problem descriptions through prompt engineering improves Copilot’s success rate after initial failure.
- To identify common characteristics of problems that remain unsolved despite prompt engineering efforts.
- To explore the pedagogical implications of prompt engineering as a learning activity in CS1 education.
- To establish a current baseline for Copilot’s performance on a public CS1 problem dataset, given rapid model evolution.
Proposed method
- Evaluated Copilot’s performance on a public dataset of 166 CS1 programming problems from CodeCheck’s Python problem bank.
- Initially tested Copilot using the original problem descriptions verbatim to determine baseline success rate.
- For problems that failed initially, applied iterative natural language prompt engineering—adding algorithmic hints, clarifying constraints, and restructuring problem statements.
- Categorized problems based on failure patterns: Poor Prompts, Verbose Prompts (Pattern), and Conceptual issues, analyzing prompt structure and clarity.
- Used qualitative and quantitative analysis to assess the impact of prompt modifications on solution correctness.
- Replicated results across multiple trials to account for non-deterministic behavior of the underlying Codex model.
Experimental results
Research questions
- RQ1RQ1: How well does Copilot perform on a public repository of CS1 programming problems using the original problem descriptions?
- RQ2RQ2: To what extent do natural language modifications to the problem description lead to successful solutions after Copilot initially fails?
- RQ3RQ3: What commonalities exist among problems that Copilot cannot solve, even after reasonable prompt engineering efforts?
- RQ4RQ4: What are the pedagogical implications of using prompt engineering as an interaction strategy with AI pair programming tools like Copilot?
Key findings
- Copilot successfully solved 50% of the 166 CS1 problems on the first attempt using the original problem descriptions.
- Of the remaining 50% of problems that failed initially, 60% were successfully solved through natural language prompt engineering, primarily by adding algorithmic hints.
- Prompt engineering was effective across all problem categories, including those involving pattern induction, string manipulation, and conceptual reasoning.
- Problems requiring inductive reasoning or implicit pattern recognition were more likely to fail initially but could be resolved with clearer, more structured prompts.
- The study identified three failure categories: Poor Prompts (ambiguous or incomplete descriptions), Verbose Prompts (overly complex or redundant instructions), and Conceptual issues (lack of clarity on edge cases or constraints).
- Despite the non-deterministic nature of the underlying Codex model, consistent success rates were observed across repeated evaluations, supporting the reliability of the findings as a current baseline.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.