Ed. Magazine Why is AI Hallucinating? Assistant Professor Ying Xu’s class unpacks the AI black box and how to stop it from misbehaving Posted November 30, 2026 By Lory Hough Artificial Intelligence in Education Illustration: Dominic Kesterton Most of the students who took Assistant Professor Ying Xu’s J-term class, Becoming AI Literate for the Future of Education, understood that AI systems like ChatGPT or Gemini sometimes make mistakes. What they didn’t really understand was why these systems make mistakes or give the answers they give. This inability to see how decisions are made, called the “black box” AI problem, was the main topic covered in this year’s two-week course. “If you think about AI systems, they are very opaque for students, especially if they are users,” Xu says. “In our class, I walked them through how an AI system is developed so they could understand more about behind-the-scenes decisions and why a system will behave in a certain way.” Assistant Professor Ying Xu One of the concepts students covered, for example, is hallucinations, which means systems like ChatGPT convincingly give incorrect or misleading information, such as made-up citations for a research paper or invented legal casees that show up in court filings. “We took a deep dive to talk about why AI hallucinations exist and what practical techniques could reduce the likelihood of hallucinations,” she says. One technique, for example, is to ask the AI system to only use credible data sets with credible sources, rather than let AI find data and sources on its own. “If a question asked is about our course, we could provide the course syllabus and lecture transcripts so that the AI system only retrieves information from the credible sources provided. It won’t make up ‘facts’ that do not exist or were not covered in the course.” Students also talk about how to build guardrails to AI systems, such as filtering out content that is deemed inapproprate for students, such as abusive or sexually explicit language. During the course, students also learn the basics that most people don’t realize are important when using AI systems, such as tips on how to phrase a good prompt or how to let AI know want you want it to accomplish with your prompt. It’s not enough, she says, to just tell ChatGPT to “write a headline with these words.” Instead, “you need to tell AI the goal. You need to describe the task,” she says. “What do you want me to do? What do you expect me to bring you? What kind of output are you expecting? What hat am I, the user, wearing or do you want AI to assume? Am I a teacher? A peer? A supervisor?” Xu says that understanding how to use AI and the “whys” of how AI generates information isn’t just nice to know for her students — it could help them in future jobs. “When I designed this course, I was thinking of students who are interested in a wide range of professions in the future,” she says. “For example, students interested in becoming product managers in ed tech companies eventually need to translate between software developers and teachers and students who are going to use the platform. If they don’t know how the system is operating, it’s very difficult for them to use precise language to describe that.” Because the J-term course is short, Xu says they can’t dive too deep into why AI does what it does, but that’s OK. “You don’t have to go into the nitty gritty details,” she says. “With this course, I wanted to put students back in the driver’s seat. AI can do a lot of programming for them, but I wanted to empower them to have the kind of agency they need to make important decisions and not just rely on AIs or external tools to do the thinking for them.” Ed. Magazine The magazine of the Harvard Graduate School of Education Explore All Articles Related Articles News J-Term Mini Course Helps Educators Think Differently About AI Innovative course fosters collaborative, responsible AI adoption Usable Knowledge Academic Resilience in a World of Artificial Intelligence Guidance for educators as generative AI changes the classroom and the world at large News The Human Element of Data and AI Gahyun Callie Sung's journey to HGSE and the LIT Lab is reflected in her research into data and using AI to improve student outcomes