| Class | Semester | Instructor | Department | License |
|---|---|---|---|---|
| Introduction to AI Applications (CPSC 1710) | Fall 2025 | Xiuye ‘Sue’ Chen | Computer Science | CC BY-NC-SA 4.0 |
Learning Objectives
- Articulate what a piece of code does precisely enough to regenerate it from a natural-language specification.
- Use iterative prompting of an AI coding assistant as a diagnostic tool for comprehension gaps.
- Distinguish between using AI-generated code and understanding it.
Description
Students receive starter code for a working program, a character-level RNN text generator (~100 lines of Python). They complete three steps:
1) Annotate the code line by line in their own words, committing the commented version to git.
2) Specify by writing a prompt.txt, which should be a plain-English description precise enough that an AI coding assistant could recreate the program from scratch.
3) Regenerate & compare: feed the prompt to an AI, run the output, and compare it to the original. Where the regenerated version diverges, the gap in the student’s specification may suggest a gap in their mental model. Iterate, commit, repeat.
Writing a code-generation prompt forces a different kind of understanding than reading or running code. Students must decide what matters, what to include, and at what level of abstraction to describe behavior.
The assignment pairs this AI-assisted exercise with a no-AI warmup (hand-tracing the RNN computation with pencil and paper), so individual understanding is established before AI enters the picture. The AI section sidesteps the policing problem, since AI is required. Git commits at each stage make the iteration process visible, so an instructor can see how many rounds a student needed and whether the specification converged.
Reflections
The specification-as-assessment approach gives a concrete, testable artifact. If the prompt works, the student understood enough to specify the behavior. If it doesn’t, the failure mode is diagnostic: missing a loss function, confusing training and generation, getting the data flow wrong; each tells you something specific about what the student missed.
The exercise works best when the starter code is small enough to annotate completely (~100 lines) but complex enough that a vague prompt won’t reproduce it. The character-level RNN hits a sweet spot: data processing, model architecture, training loop, and text generation, all in one file.
Tools
Any AI coding assistant of the student’s choice (ChatGPT, Claude, Copilot, etc.)