Stanford Bans AI Coding Assistants from Writing Code in CS336

Key Takeaways

- AI assistants in CS336 cannot write Python, pseudocode, or complete any TODO sections
- Students must submit their full AI interaction history with assignments
- The policy establishes 4 core principles for AI-as-tutor instead of AI-as-developer
Stanford's CS336 course has published a mandatory guidelines file that transforms how AI coding assistants interact with students. The policy is simple: Claude, ChatGPT, GitHub Copilot, and Cursor must function as teaching assistants. They cannot write a single line of code.
The course, titled "Language Modeling from Scratch," teaches students to build large language models from the ground up. It is intentionally implementation-heavy. Students write tokenizers, transformer blocks, optimizers, training loops, Triton kernels, and distributed training logic themselves. The new AI guidelines ensure that remains true even when students use AI tools.
What AI Tools Cannot Do
The prohibited list is extensive. AI assistants cannot write any Python or pseudocode. They cannot complete TODO sections in assignment code. They cannot edit code in student repositories, run bash commands, or refactor large portions of student code into finished solutions.
The restrictions extend to indirect help. AI tools cannot point students to third-party implementations. They cannot convert assignment requirements directly into working code. They cannot even give students "the idea for how to solve a problem."
- No writing Python or pseudocode
- No completing TODO sections
- No running bash commands
- No implementing core components like tokenizers, transformer blocks, or Triton kernels
- No pointing to external implementations
The Socratic Tutor Model
The guidelines establish what AI tools should do instead. When a student asks for help, the AI must ask clarifying questions about what they tried, what they expected, and what happened. It should reference concepts from lecture materials or documentation rather than giving direct answers.
“The goal is not to have an AI finish the assignment, but to have it act as a Socratic tutor that points you to the relevant literature and forces you to derive the implementation yourself.”
— CS336 Course Staff
AI assistants can explain error messages from Python, PyTorch, CUDA, Triton, and distributed training tools. They can suggest sanity checks, toy examples, and assertions. They can review code students have written and suggest areas for improvement. But all feedback must be general. The AI must point students toward problems, not hand them solutions.
Mandatory Interaction Logs
Enforcement relies on transparency. Students must include their complete AI interaction history, stored in a .history folder, with every assignment submission. This creates an audit trail showing whether students used AI as an educational tool or as a code generator.
The 100% mandatory inclusion of AI logs means instructors can review exactly how students interacted with their AI assistants. A student who asks Claude to explain why their attention mask produces NaN values gets help. A student who asks Claude to write a working attention mask gets flagged.
Four Core Design Principles
The guidelines establish four principles that structure AI behavior in the course. First, AI agents explain concepts when students are confused by guiding them toward understanding, not delivering answers. Second, they point students to relevant lecture materials, handouts, and official documentation. Third, they help debug by asking guiding questions rather than providing fixes. Fourth, they suggest sanity checks and profiler-based investigations through active dialog.
Each principle preserves student agency. The AI becomes a conversation partner that helps students think, not a contractor that completes their work.
Community Response
Discussion on Hacker News has been largely supportive. Professional developers praised the approach as teaching students "how to learn with AI" rather than how to copy-paste generated code. Some debate exists around enforcement, but instructors point to the mandatory .history folder as a practical audit mechanism.
The policy reflects a broader tension in technical education. AI coding assistants can write working code faster than most students. But if the goal is learning, not output, speed becomes irrelevant. Stanford's approach treats AI competence and implementation competence as separate skills. Students develop both by using AI as a tutor while building systems themselves.
Example from the Guidelines
The guidelines include an example interaction. A student says: "My causal mask seems wrong and training blows up. Please tell me what my mistake is." The correct AI response is not to identify the bug. Instead, the AI should ask what shape the student expects, what values they see, and whether they have tried a toy example with a 3x3 mask to verify behavior.
This Socratic approach forces students to develop debugging skills. Finding a bug yourself, with hints, builds different mental models than reading an AI-generated fix.
Logicity's Take
Frequently Asked Questions
What AI tools are covered by Stanford's CS336 guidelines?
The guidelines explicitly cover ChatGPT, Claude Code, GitHub Copilot, Cursor, and any similar AI coding assistants students might use.
Can AI assistants help debug code in CS336?
Yes, but only through guiding questions. AI tools can explain error messages and suggest what to investigate, but they cannot provide fixes or identify specific bugs directly.
How does Stanford enforce the AI tutor policy?
Students must submit their complete AI interaction history in a .history folder with every assignment. Instructors can review these logs to verify appropriate AI usage.
What happens if an AI writes code for a CS336 student?
The guidelines prohibit AI tools from writing any Python or pseudocode. Interaction logs that show code generation would indicate policy violations.
Explores productive ways to use AI coding assistants within appropriate boundaries
Examines the gap between AI demo capabilities and real-world educational use
Need Help Implementing This?
Source: Hacker News: Best
Huma Shazia
Senior AI & Tech Writer
Related Articles
Browse all
Robotaxi Companies Are Hiding How Often Humans Take the Wheel
Autonomous vehicle firms like Waymo and Tesla are under scrutiny for refusing to disclose how often remote operators step in to control their self-driving cars. A Senate investigation reveals major gaps in transparency, raising safety and accountability concerns.

Wisconsin Governor Throws a Wrench in Age Verification Plans
Wisconsin Governor Tony Evers has vetoed a bill that would have required residents to verify their age before accessing adult content online, citing concerns over privacy and data security. This move comes as several other states have already implemented similar age check requirements. The veto has significant implications for the future of online age verification.

Apple's App Store Empire Under Siege: The Battle for the Future of Tech
The long-running feud between Apple and Epic Games has reached a boiling point, with Apple preparing to take its case to the Supreme Court. The tech giant is fighting to maintain control over its App Store, while Epic Games is pushing for more freedom for developers. The outcome could have far-reaching implications for the entire tech industry.

Tesla's Remote Parking Feature: The Investigation That Didn't Quite Park Itself
The US auto safety regulators have closed their investigation into Tesla's remote parking feature, but what does this mean for the future of autonomous driving? We dive into the details of the investigation and what it reveals about the technology. The National Highway Traffic Safety Administration found that crashes were rare and minor, but the investigation's closure doesn't necessarily mean the feature is completely safe.
Also Read

iOS 26.5.1 Fixes Charging Bug on iPhone Air and iPhone 17
Apple released iOS 26.5.1 and macOS 26.5.1 on June 1, 2026, addressing two specific bugs before next week's WWDC. The iOS update fixes a wired charging failure that affected iPhone Air and iPhone 17 models when batteries were nearly drained. The macOS patch resolves unexpected shutdowns on M5 Macs running enterprise content filtering tools.

How Hackers Tricked Meta's AI Chatbot Into Stealing Instagram Accounts
Attackers exploited Meta's AI support chatbot to hijack high-profile Instagram accounts, including government pages, by simply asking it to change email addresses. The exploit was active for months before Meta patched it on May 29, with some stolen accounts valued above $1 million on the gray market.

DriveSurge Hijacks Thousands of Sites to Spread Malware
A threat actor called DriveSurge has compromised thousands of legitimate websites to distribute malware through fake browser updates and deceptive 'fix' prompts. The campaign targets Windows and macOS users by redirecting visitors through a traffic distribution system that profiles victims before choosing the most effective social engineering lure.