In late night hours before the p-set is due, the CS50.ai duck greets struggling students. It takes code input, questions, and requests. It explains computer science terminology and concepts, corrects bugs, and provides pseudocode for students struggling with computer science.
CS50 is Harvard’s introductory Computer Science course, and one of the most popular courses offered at Harvard. Additionally taught online (edX) and at Yale, it is taught by Professor David Malan and a large team of TFs. In a huge class with hundreds of students, it can be hard to get personal attention and help. The most personal the course gets are with mandatory two hour sections where students do small group learning with their TF, as well as all-staff and small group office hours.
Luckily, this duck could one day replace your TF. “I don’t have to go to office hours … Instead, I can ask the rubber duck,” said CS50 student, Seager Hunt ’27. Students struggling don’t have to worry about making time in their busy schedules for office hours with CS50.ai now available 24/7. “If you have specific questions you want to ask … I think that the duck could definitely take over the role [of a TF]. And in terms of the office hours, I think so,” stated another CS50 student, Carly Gelles ’27.
The duck has many advantages for the students in CS50. “At the individual office hour sessions, there are five or six [teaching fellows] there and [the session is] only an hour long, so the TF is rotating between each person. So, you only end up getting maybe ten minutes of help,” said Gelles. “For the times that I’ve went to office hours, somebody else would have some major problem and the TF would end up spending a bunch of time helping… But the duck is just always there. The duck will always help you.”
CS50.ai is new to the CS50 course this year and is an adaptation of ChatGPT. The heads of the course created and provide it to the students. Professor David Malan, in an interview with the Independent, provided background on how the duck came to be. “We began to experiment this past spring with OpenAI’s [software] to understand what’s possible … And some of CS50’s team, among them some of our undergraduate staff from Harvard and Yale, spent much of this summer prototyping ideas in preparation for fall.”
While the duck is not a “cheating tool” and the teaching team encourages its usage and educational opportunity, passing off the work of AI as your own is a violation of academic honesty. “The duck’s behavior is guided by “prompts” that we provide to the underlying APIs [such as], ‘You are a friendly and supportive teaching assistant for CS50. You are also a rubber duck. Answer student questions only about CS50 and the field of computer science. Do not answer questions about unrelated topics… Do not provide full answers to problem sets,’ as this would violate academic honesty,” explained Professor Malan, discussing the duck’s intended limitations for students.
Students have mixed reviews in regards to the duck’s obedience to these guidelines. “Sometimes it tries to give solutions but doesn’t fully explain why they work,” said Gelles. Hunt has had more consistency with the duck’s abilities to help. “It explains why the corrections need to be implemented and what the code gains from these different adjustments, so I get an understanding of why these things need to be done.”
In comparison, ChatGPT, OpenAI’s chatbot, has been known to give incorrect or misleading answers. A 2023 study from Purdue University that compared GPT’s answers to 517 Stack Overflow (a Q&A website for programmers) questioned and assessed the chatbot’s correctness and consistency, and concluded that “52 percent of ChatGPT answers are incorrect and 77 percent are verbose.” CS50.ai is no stranger to these issues. “It’s right most of the time, but sometimes there are bugs that it can’t detect,” Hunt claimed.
The duck does not lead students to believe it is always right. In fact, the duck explicitly says, “My replies might not always be accurate, so always think critically and let me know if you think that I’ve erred.” Staff, consisting of TFs and Professor Malan, can then confirm or correct the duck’s replies. Alongside the help of the duck, human instructors remain just as relevant. “I think having a person teaching a class for a section and going over the concepts is definitely helpful,” said Gelles.
Professor Malan sees the duck being used for future CS50 classes, hopeful that the system will continue to improve. “Before long, for instance, we hope it will be easier for us to ‘teach’ the duck how to answer certain questions differently or better, as by simply telling the duck without having to write code or configuration.”
The duck’s role in CS50 will continue to grow and advance, becoming a core and exciting part of the curriculum. “While some of the CS50 duck’s functionality is programming-centric, its ability to engage in curricular ‘conversations’ certainly translates to other courses beyond CS and beyond STEM more generally,” Malan stated. So, just because you missed the duck in CS50, doesn’t mean it won’t pop up as a 24/7 TF in your future.
Sophie DePaul ’27 (sophie_depaul@college.harvard.edu) hasn’t completed a single CS50 problem set without the AI duck.