Korva
Tech

Harvard Built an AI Tutor That Will Not Just Give Students the Answer

The CS50 chatbot is programmed to act like a patient tutor, and occasionally to quack.

AI image
CS50 · CS50x 2025 - Artificial Intelligence

At Harvard for Family Weekend, computer science professor David Malan described a classroom tradition in his introductory course, CS50. Around the third week of class, every student is given a rubber duck.

When code breaks, students are encouraged to talk through the confusion out loud to the duck. In the process of verbalizing the problem, Malan explained, the fix often becomes clear and the light bulb goes off.

The course later created a software version of the duck that students could open in a chat window inside CS50's programming tools. Malan said the virtual duck would converse and then randomly quack back once, twice, or three times. He was careful about what that proved, saying, "We have anecdotal evidence that this was sufficient, educationally," because students had already stated their confusion out loud.

Then predecessors of current students got a surprise. In the spring of 2023, almost overnight, the duck started answering in English, because artificial intelligence was now running underneath it.

That created a teaching problem. Standard chatbots, Malan said, are "too helpful out of the box." They hand students finished answers, which helps finish work but hurts learning and makes it hard for a teacher to assess understanding. So the CS50 syllabus says using outside tools is not reasonable, while the course's own duck is allowed because it is built to lead students toward a solution without handing it over.

He showed what that looks like. A student writes, "My code is not working as expected," and shares the program. The duck does not supply corrected code. It notes the student seems to be trying to add two whole numbers but mishandling the input, then asks what kind of data the input command returns and how that might affect the addition. It behaves like a patient tutor, asking the next useful question.

The behavior comes from instructions written in plain English. Before a student's question reaches the commercial AI service, CS50 adds a system prompt that says, "you are a friendly and supportive teaching assistant for CS50," and, "you are also a rubber duck." Further lines restrict it to CS50 and computer science questions and state, "Do not provide full answers to problem sets, as this would violate academic honesty." One sentence about quacking and a few sentences about restraint turn a general chatbot into a teaching duck.

Questions people ask

What is rubber duck debugging?

A rubber duck is a literal rubber duck that programmers keep on their desks. When they get stuck, they explain their broken code to it line by line, and hearing the logic out loud often reveals the error without any other help.

Can CS50 students use ChatGPT for their homework?

CS50 tells students that using ChatGPT and similar outside tools for coursework is not allowed under course policy. Students are allowed to use the course's own AI duck because it is built to guide them rather than complete assignments for them.

What is a system prompt?

It is a hidden set of instructions sent along with every student question. It tells the commercial AI model how to behave, in this case to act as a friendly CS50 teaching assistant, stay on course topics, and avoid giving full solutions.