ChatGPT in the Classroom: An Analysis of Its Strengths and Weaknesses for Solving Undergraduate Computer Science Questions

Ishika Joshi, Ritvik Budhiraja, Harshal Dev, Jahnvi Kadia, Mohammad Osama Ataullah, Sayan Mitra, Dhruv Kumar, Harshal D. Akolekar · DOI

TL;DR

This paper evaluates ChatGPT’s performance across a broad spectrum of undergraduate Computer Science topics, finding a mediocre mean accuracy of 56.9%. While the model excels at coding tasks when given proper context, its surprising unreliability in basic theory and numerical problems suggests that students relying on it for "easy" answers are at a high risk of academic self-sabotage.

What Problem Does This Paper Address?

Since the release of ChatGPT, academia has been caught between "frenzy and fear." While much of the existing research has focused on whether Large Language Models (LLMs) can solve introductory programming assignments (CS1/CS2), this paper addresses a wider gap: how does ChatGPT handle the full breadth of a CS curriculum?

The authors investigate whether the tool is a reliable companion for subjects like Operating Systems and Databases, and whether it can handle diverse question formats—ranging from simple True/False and multiple-choice questions (MCQs) to complex design-based problems and competitive exam queries. The goal is to quantify the risk of "self-sabotage" for students who might blindly trust the AI's output.

Methods

The researchers employed a quantitative benchmarking approach. They manually collected questions from prestigious university exams (MIT, Stanford, UC Berkeley, and various IITs) and competitive platforms.

The evaluation process involved:

  1. Prompting: Feeding questions to ChatGPT (primarily GPT-3.5) one at a time.
  2. Contextualization: Testing the impact of "persona" prompts (e.g., "You are a computer science UG student preparing for technical interviews").
  3. Grading: Authors used their domain expertise to categorize responses as Correct, Incorrect, or Partially Correct.
  4. Subject Coverage: The study spanned Data Structures and Algorithms (DSA), Operating Systems (OS), Database Management Systems (DBMS), and Machine Learning (ML).

Datasets

The study utilized a diverse set of "real-world" academic data:

  • Core Curriculum: Mid-term and final papers from MIT, Stanford, and UC Berkeley.
  • GATE: Questions from the Graduate Aptitude Test in Engineering, a high-stakes national exam in India used for postgraduate admissions.
  • LeetCode: Two categories—one focused on specific subtopics and another using the "Blind75," a curated list of frequently asked interview questions.

Key Insights and Ideas

  • The Contextualization "Superpower": One of the most striking findings was how much a prompt matters. When ChatGPT was told it was a student preparing for interviews, its accuracy on LeetCode problems jumped to a staggering 92.8%. Without context, it often fixated on the wrong parts of a problem.
  • The "Believable" Hallucination: ChatGPT is often "confident but wrong." It can provide a beautifully framed, logical-sounding explanation that leads to a completely incorrect final answer. This is particularly dangerous for students who lack the depth to spot the subtle logical pivot where the AI goes off the rails.
  • Inconsistency at the Foundation: Surprisingly, the model often failed at basic fact-based questions or direct formulas (like graph theory properties) while successfully navigating much more complex, "well-framed" problems.
  • Subject-Wise Disparity: There is a massive performance gap between subjects. It performed best in DSA (70.1%) but struggled significantly in DBMS (33.4%), suggesting that the underlying training data or the nature of relational logic may be a weak point for the model.

Key Results

  • Overall Accuracy: 56.9% across all subjects and categories.
  • Best Question Type: Design-based questions (76%) and True/False (75.4%).
  • Worst Question Type: Numerical questions (39.5%) and MCQ/MSQs (41.3%).
  • Subject Performance:
    • DSA: 70.1%
    • Operating Systems: 58.4%
    • Machine Learning: 51.4%
    • GATE (Competitive Exam): 49.0%
    • DBMS: 33.4%
  • LeetCode: Category 2 (with context) reached 92.8%, while Category 1 (standard subtopics) sat at 54.2%.

Limitations and Future Work

The authors acknowledge several limitations:

  • Model Versioning: The study primarily reflects GPT-3.5; the authors note that GPT-4 (the paid version) likely performs better, though it was less accessible at the time of the study.
  • Lack of Human Perspective: The current analysis is purely quantitative based on the AI's output. Future work aims to incorporate the actual perspectives of students and teachers using these tools in the wild.
  • Geographic Bias: The subpar performance on GATE questions suggests a potential training data bias, as GATE is specific to the Indian educational context. The authors suggest that a more inclusive corpus of global academic materials is needed to make LLMs truly useful worldwide.

Ultimately, the paper recommends that instructors move toward "higher-order" questions that require critical thinking rather than rote formula application, as these remain ChatGPT's Achilles' heel.

Summary updated

Abstract

ChatGPT is an AI language model developed by OpenAI that can understand and generate human-like text. It can be used for a variety of use cases such as language generation, question answering, text summarization, chatbot development, language translation, sentiment analysis, content creation, personalization, text completion, and storytelling. While ChatGPT has garnered significant positive attention, it has also generated a sense of apprehension and uncertainty in academic circles. There is concern that students may leverage ChatGPT to complete take-home assignments and exams and obtain favorable grades without genuinely acquiring knowledge. This paper adopts a quantitative approach to demonstrate ChatGPT's high degree of unreliability in answering a diverse range of questions pertaining to topics in undergraduate computer science. Our analysis shows that students may risk self-sabotage by blindly depending on ChatGPT to complete assignments and exams. We build upon this analysis to provide constructive recommendations to both students and instructors.
BibTeX
@misc{joshi2023chatgpt,
  author = {Ishika Joshi and Ritvik Budhiraja and Harshal Dev and Jahnvi Kadia and Mohammad Osama Ataullah and Sayan Mitra and Dhruv Kumar and Harshal D. Akolekar},
  title = {{ChatGPT in the Classroom: An Analysis of Its Strengths and Weaknesses for Solving Undergraduate Computer Science Questions}},
  year = {2023},
  eprint = {2304.14993},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.14993},
}
Figure