Thursday, February 27, 2025

GenAI as a Teacher Guide and Coding Companion (Part 1) – Communications of the ACM

Computer scienceGenAI as a Teacher Guide and Coding Companion (Part 1) – Communications of the ACM


Like many in the K-12 CSEd community, I‘ve been reflecting on the changing landscape of computing—and coding—education in the age of Generative AI (GenAI). I have shared these evolving thoughts in recent presentations and keynote addresses (including a couple in India, at IISc Bangalore and IIT Gandhinagar in December 2024). I am skeptical about “AI everything, everywhere, all at once.” My key concerns about pushing GenAI in K-12 classrooms stem from two primary concerns: (1) Rushed implementation without a research base and sufficient consideration of essential questions: Why, what, where, when, who, and how? and (2) Insufficient focus on the foundations of how children learn, an area enriched by decades of research in the learning sciences. I’ve elaborated on these concerns in an hour-long lecture at the National Academies of Science, Engineering, and Mathematics titled “K-12 Education in the Age of AI: The Role of the Social Sciences in Shaping Learning Designs for a Transformative Technological Era” (delivered as part of the 2024 Henry and Bryna David award in October 2024), and also a 10-minute TV appearance on NTD Capitol Report in January.

All that being said, the genie is out of the bottle, as the saying goes. We cannot ignore the reality that GenAI is out there—in the hands of the general populace, including students. It is a powerful tool that has the potential to impact both what we teach and how we teach it. The former has implications for skills like coding (and essay writing) that GenAI models are astoundingly good at. Take a look at GenAI’s response to coding the Rock-Paper-Scissors game—a popular game to program in block-based environments like Scratch in upper elementary and middle school when students learn about conditionals. Both ChatGPT (Figure 1) and Claude (Figure 2) provided detailed, well-commented code (though Claude needed an additional prompt to add comments). Claude’s code is available here. Even though LLMs are not able to create graphical block-based versions of the solution, and the solution could be prompted to make the game more engaging with images for sprites, they provide sound logic for a basic game in pseudo-code along with explanations and comments. The instructions are detailed enough to get a student or teacher going with what sprites and variables to set up, and also what code to add to control each sprite. What’s more, one can also get comprehensive explanations for what the code is doing and why—explanations that match those from a human teacher. ChatGPT’s response even provides helpful headers for functional chunks like “code for determining the winner.” LLMs are also able to understand and evaluate screenshots of Scratch code as well as suggest improvements.

Figure 1. ChatGPT’s response to “Create a Rock-Paper-Scissors game in Scratch”

Figure 2 GenAI Part 1

Figure 2. Claude’s response to “Create a Rock-Paper-Scissors game in Scratch that ends after the best of 7”. The code is published at https://bit.ly/4kg0Dmi

Other explorations in the realm of integrating STEM learning and coding were equally impressive. Since I work a fair bit on projects involving the integration of coding and computational thinking into STEM learning, I decided to experiment with computational and agent-based modeling (ABM) exercises. Lo and behold, ChatGPT4 produced very well-documented Python code (Figure 3) to create a simulation of the pressure-temperature gas law along with instructions (that I have not shown here) on how to run it from a terminal window on a Mac.

Figure 3 GenAI Part 1

Figure 3. Python simulation of the pressure-temperature gas law

Figure 4 GenAI Part 1

Figure 4. Explanation and pseudocode of bacteria-antibiotics agent-based computational model

In another instance, the briefest of prompts to GPT4—Create a (multiple) agent-based model that models bacteria-antibiotics relationship—resulted in an amazingly helpful and detailed response (Figure 4). This prompt was inspired by presentations of ABM projects in K-12 classrooms shared by participants of the Making Sense of Models: Decoding & Beyond conference/workshop in November 2024. The response began by sharing the model overview as well as model components and behaviors, and then proceeded to share the pseudocode for the ABM and explanations of each step in addition to extensions. The introduction also stated that the pseudocode could be implemented in a programming environment like NetLogo, which is well suited to agent-based modeling (and is currently the most popular ABM language in K-12 settings).

While these examples unleash a flurry of ideas for how we might reshape classroom learning from the vantage point of the student—the learning goals of teaching programming and the design of curricular experiences—my first thought went to what this means for K-12 teachers! While we need to give a lot of thought to if and how we might integrate GenAI into student-facing K-12 programming activities, there are immediately obvious use cases for teachers. Preparing teachers to teach coding has been the single biggest challenge in K-12 CS education. Most elementary and middle school CS teachers have little to no background in programming, and in most instances (around the world), there are crippling shortages of time and resources to provide the level of sustained support teachers need to become comfortable with programming in various block-based and text-based programming languages and environments used in K-12. Many novice CS teachers have expressed feeling like they’ve been thrown into the deep end of the pool when they enter the classroom after one or two weeks of summer professional development aimed at preparing them to be a CS teacher. (Kudos to teachers everywhere who have courageously taken the plunge and worked tirelessly to advance learning of coding in classrooms.) 

GenAI can be the perfect coding companion for teachers! Given the capabilities of current foundational and reasoning LLMs, it is reasonable to expect that accurate solutions, explanations, extensions, and comments in any language for any K-12 coding exercise are now available anytime/anywhere to K-12 teachers. Think of what this means for teacher confidence and for designing teacher professional development!

Imagine what this also means for those Science and Math teachers who find knowledge of coding to be a barrier to integrating computational modeling in their classrooms. Those who’ve worked with non-CS STEM teachers to integrate coding and computational modeling into STEM learning can relate to the enormous barrier coding poses to STEM+C integration. It has always seemed unrealistic to expect Science and Math teaching, writ large, to effortlessly incorporate coding and creation of computational models of real-world phenomena—even with the affordances of the many modeling environments that have been designed. At the Making Sense of Models: Decoding and Beyond workshop (hosted by Irene Lee in November 2024, and funded by her group’s NSF-funded projects to study mechanistic reasoning), participants shared many strategies for how we can ease the burden of computational modeling on teachers and students in non-CS classrooms. The throughline was an acknowledgement of the uphill struggle coding presents for Science and Math teachers trying to embrace computational modeling and computational thinking that have been called out in recent STEM standards as necessary practices. LLMs can significantly democratize the use of computational approaches in non-CS (especially STEM) classrooms by helping teachers integrate computational activities, even if they are not familiar with coding.

I can envision CS and non-CS teachers talking with LLMs as expert coding companions and thought partners, about goal statements, providing context, and learning through coding solutions and explanations generated by GenAI. They could even ask follow-up prompts for additional explanations and alternate solutions, get help examining student work for bugs, and evaluate different solutions from various LLMs. Given that LLMs like ChatGPT and Claude have a minimum age requirement of 13 for use and are currently not allowed in classrooms, their use by teachers is not only feasible and practical, but it can guide and support students’ project-based learning (where students create open-ended projects of choice). My other interactions with LLMs also suggest that they are familiar with the state of the art in K-12 programming pedagogy, as well as project-based, student-centered, culturally relevant learning philosophies from CSEd research and can be prompted to draw on them for additional customization and support. The safe and productive use of GenAI directly by students in K-12 CS classrooms is less clear without adequate research. Learning is a social, relationship-driven endeavor. I believe a classroom with a human teacher armed with support from LLMs will result in better learning than putting LLMs directly in the hands of students. Though there is undoubtedly an argument for educating secondary students about the appropriate use of LLMs as part of developing their AI literacy, these activities need to be designed carefully. There are known problems associated with the unfiltered use of foundational LLMs by minors and populations lacking the critical thinking skills to evaluate inaccurate or harmful responses. In addition to asking how we can incorporate student-facing GenAI in the learning of programming, there is also the more significant question of what our learning goals for teaching programming are and how we need to adjust them in the age of GenAI. I will delve into my evolving thoughts on these questions in Part 2 of this series.

Shuchi Grover

Shuchi Grover is a computer scientist and learning scientist based in Austin, TX. She is currently Director, AI & Education Research at Looking Glass Ventures. Her research over the last 15 years has focused on K-12 computer science education, and especially computational thinking in CS and STEM+Computing integration settings at the primary and secondary school levels. She currently advises national and global efforts on AI education, as well as AI in education in K-12 schools, in addition to leading NSF-funded research efforts on these topics.

Check out our other content

Check out other tags:

Most Popular Articles