Stanford CS336 mandates AI coding assistants act as tutors, not solution generators
Stanford University has published strict usage protocols for artificial intelligence tools in its CS336 course, ensuring students engage directly with Python and PyTorch code rather than relying on automated completion.
Stanford University has introduced formal guidelines governing the use of artificial intelligence coding assistants within its CS336 Language Modeling From Scratch course. The directive, published in the course’s assignment repository, mandates that tools such as Claude Code and GitHub Copilot function strictly as pedagogical aids rather than automated solution generators.
The course is designed to be implementation-heavy, requiring students to construct fundamental components like tokenizers and attention mechanisms from the ground up using Python and PyTorch. To preserve the integrity of this learning experience, the guidelines stipulate that AI agents must refuse direct implementation requests. Instead, they are instructed to provide debugging guidance, code reviews, and high-level conceptual outlines.
Specific examples within the documentation illustrate the expected behaviour. When a student encounters issues with a causal mask or a slow BPE tokenizer, the agent is directed to guide the student toward checking specific technical details, such as mask application before softmax or profiling GPU utilization, rather than providing the corrected code. If a request crosses the line into direct solution generation, the agent must pivot to explanation or refer the student to course staff.
The instructions emphasise that AI tools are permitted for low-level programming help and high-level conceptual questions but are prohibited from directly solving assignment problems. The goal is for students to learn by doing, ensuring they maintain a deep technical understanding of the underlying mechanisms rather than simply observing AI-generated solutions.
This approach addresses the growing tension in computer science education between leveraging AI for efficiency and preserving academic integrity. By defining clear boundaries for AI interaction, Stanford aims to ensure that students in CS336 develop the substantial coding skills necessary for the course, which focuses on language modelling from scratch rather than mere API usage.


