All posts
Trending Tech

Stanford Bans AI Coding Assistants from Writing Code in CS336

Huma Shazia2 June 2026 at 3:52 am5 min read
Stanford Bans AI Coding Assistants from Writing Code in CS336

Key Takeaways

Stanford Bans AI Coding Assistants from Writing Code in CS336
Source: Hacker News: Best
  • 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.

Also Read
10 Microsoft Copilot Tricks That Save Time and Protect Privacy

Explores productive ways to use AI coding assistants within appropriate boundaries

Also Read
Does Gemini Spark Live Up to Google's Demo Promises?

Examines the gap between AI demo capabilities and real-world educational use

ℹ️

Need Help Implementing This?

Source: Hacker News: Best

H

Huma Shazia

Senior AI & Tech Writer

Related Articles

Tesla's Remote Parking Feature: The Investigation That Didn't Quite Park Itself
Trending Tech·8 min

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.