Using Contrasting Examples with Generative AI: Extending the “Example Machine”
In her Cult of Pedagogy article, “How to Use ChatGPT as an Example Machine,” Jennifer Gonzalez demonstrates how teachers can use generative AI to rapidly create multiple examples of a concept. She outlines a five-step process: identify the concept, choose dimensions of contrast, generate examples, sequence and label them, and then reflect and discuss. This method shows how AI can serve as a practical classroom assistant. In this post, I extend Gonzalez’s work by connecting it to learning theories and by applying it to coding education, which is both part of my teaching practice and my dissertation research on AI augmented learning.
Why Contrasting Examples Work: Two Learning Theories
Cognitive Load Theory suggests that working memory is limited. If students only see one example, they may struggle to filter out irrelevant details. Contrasting examples reduce unnecessary cognitive load by clarifying what matters. For example, showing a functioning loop in Python next to a broken one helps students focus on the feature that determines success.
Schema Theory explains how learners build mental frameworks that allow them to organize knowledge. Contrasting examples sharpen these frameworks by highlighting both similarities and differences. In coding, comparing a for loop and a while loop strengthens the “loop” schema by showing when each structure is useful. Together, these theories show why contrasting examples improve long-term understanding and transfer to solving problems.
Applying the Example Machine Process to Coding
Using Gonzalez’s five steps, here is how contrasting examples can be applied in a beginner coding class:
-
Identify the concept
Students often confuse correct versus incorrect variable assignment in Python. -
Choose dimensions of contrast
The contrast will focus on valid syntax versus invalid syntax. -
Generate examples
Correct:
Incorrect:
-
Sequence and label
First show the working code, then the error-producing code. Label each one clearly so students know what to compare. -
Reflect and discuss
Ask students why the second example fails. In doing so, they recognize the rule that variable names cannot include spaces, a rule they are more likely to remember because they have seen both sides of it.
Another Example: Loop Conditions
A similar approach works for teaching loops:
Correct:
Incorrect (infinite loop):
By contrasting these, students see the importance of updating the loop variable. The failure case makes the concept memorable and supports error-based learning.
Conclusion: Beyond the Example Machine
Contrasting examples do more than clarify content; they embody the cycle of learning I am exploring in my dissertation research on AI-augmented learning. In that model, AI acts as both coach and collaborator, providing rapid iterations that teachers can refine into effective scaffolds. Gonzalez’s article demonstrates how to start and extend it with educational psychology and authentic coding examples, revealing deeper potential. Contrasts not only help students learn, but they also help teachers use AI more strategically in the classroom.
References
Gonzalez, J. (2023). How to use ChatGPT as an Example Machine. Cult of Pedagogy. https://www.cultofpedagogy.com/chatgpt-example-machine/
Sweller, J. (1988). Cognitive load during problem solving: Effects on learning. Cognitive Science, 12(2), 257–285.
Rumelhart, D. E. (1980). Schemata: The building blocks of cognition. In R. J. Spiro, B. C. Bruce, & W. F. Brewer (Eds.), Theoretical issues in reading comprehension (pp. 33–58). Erlbaum.
Robert Foreman
DET Student
📧 Contact: forem1r@cmich.edu
🌐 Central Michigan University | NhanceData.com
📱 480-415-0783
#EdTech #GenerativeAI #LearningDesign #EducationalPsychology #CognitiveLoadTheory #SchemaTheory #NhanceData
