Skip to main content
QUICK REVIEW

[논문 리뷰] Large Language Models (GPT) Struggle to Answer Multiple-Choice Questions about Code

Jaromír Šavelka, Arav Agarwal|arXiv (Cornell University)|2023. 03. 09.
Software Engineering Research인용 수 4
한 줄 요약

이 연구는 초급 및 중급 파이썬 과정에서 나온 코드 스니펫을 포함한 다중선택지 문제(MCQ)에 대해 GPT 모델의 성능을 평가한다. 자연어 MCQ에서 뛰어난 성능(정확도 77.9%)을 보였지만, 코드 관련 추론 작업에서는 정확도가 59.5%에 그치며, 실행 추적 또는 논리적 분석이 필요한 문제에서 가장 낮은 성능(56.6%)을 보였다.

ABSTRACT

We analyzed effectiveness of three generative pre-trained transformer (GPT) models in answering multiple-choice question (MCQ) assessments, often involving short snippets of code, from introductory and intermediate programming courses at the postsecondary level. This emerging technology stirs countless discussions of its potential uses (e.g., exercise generation, code explanation) as well as misuses in programming education (e.g., cheating). However, the capabilities of GPT models and their limitations to reason about and/or analyze code in educational settings have been under-explored. We evaluated several OpenAI's GPT models on formative and summative MCQ assessments from three Python courses (530 questions). We found that MCQs containing code snippets are not answered as successfully as those that only contain natural language. While questions requiring to fill-in a blank in the code or completing a natural language statement about the snippet are handled rather successfully, MCQs that require analysis and/or reasoning about the code (e.g., what is true/false about the snippet, or what is its output) appear to be the most challenging. These findings can be leveraged by educators to adapt their instructional practices and assessments in programming courses, so that GPT becomes a valuable assistant for a learner as opposed to a source of confusion and/or potential hindrance in the learning process.

연구 동기 및 목표

  • 프로그래밍 교육에서 코드 스니펫을 포함한 다중선택지 문제(MCQ)에 대해 GPT 모델의 효과성을 조사하는 것.
  • 특히 코드 동작에 대한 추론이 요구되는 문제들 중에서 GPT 모델이 가장 어려워하는 문제 유형을 특정하는 것.
  • 다른 GPT 버전들(text-davinci-001, text-davinci-002, text-davinci-003)이 코드 관련 평가에서 성능을 어떻게 비교하는지 분석하는 것.
  • 교육자들이 GPT 도구를 프로그래밍 수업과 평가에 책임감 있게 통합할 수 있도록 실증적 통찰을 제공하는 것.
  • 프로그램 의미론에 대한 추론, 특히 실행 추적과 논리적 성질에 대한 이해의 한계를 이해하기 위한 기반을 마련하는 것.

제안 방법

  • 세 개의 postsecondary 수준 파이썬 과정에서 530개의 MCQ를 수작업으로 수집하고, 문제 유형별로 분류하였다.
  • 문제의 인지적 요구 수준에 따라 진위, 출력 예측, 빈칸 채우기 등 유형으로 분류하였다.
  • 제로샷 프롬프팅을 사용하여 동일한 MCQ 세트에 대해 세 가지 GPT 모델(text-davinci-001, text-davinci-002, text-davinci-003)을 평가하였다.
  • 정확한 일치와 자카르 유사도 지표를 사용하여 성능을 측정하였으며, 무작위 추측의 기준은 23.4% 자카르 유사도였다.
  • 일致한 레이블링과 신뢰할 수 있는 성능 측정을 확보하기 위해 패턴 매칭과 수동 검증을 사용하였다.
  • 실행 시뮬레이션 및 의도 추론과 같은 인지적 과제를 분리하기 위해 문제 유형 간 성능 차이를 분석하였다.
Figure 1: The upper-left screenshot depicts a conversation with ChatGPT when asked to explain a code snippet line by line. It correctly explains the bahavior (1). The lower-right shows a conversation with ChatGPT when asked to generate the code snippet with the same behavior. The generated code is c
Figure 1: The upper-left screenshot depicts a conversation with ChatGPT when asked to explain a code snippet line by line. It correctly explains the bahavior (1). The lower-right shows a conversation with ChatGPT when asked to generate the code snippet with the same behavior. The generated code is c

실험 결과

연구 질문

  • RQ1코드 스니펫을 포함한 MCQ와 자연어만 포함한 MCQ 사이에서 GPT 모델의 성능에 유의미한 차이가 있는가?
  • RQ2예를 들어 출력 예측, 진위, 빈칸 채우기 등 어떤 유형의 MCQ가 코드 동작에 대한 추론이 요구될 때 GPT 모델에게 가장 어려운가?
  • RQ3최신 GPT 모델들(예: text-davinci-003)이 코드 관련 추론 작업에서 이전 버전들(예: text-davinci-001)보다 성능이 어떻게 다른가?
  • RQ4GPT 모델이 코드 실행을 시뮬레이션하거나 프로그램 동작을 추론하는 데 얼마나 실패하는가, 그리고 이는 정확도에 어떤 영향을 미치는가?

주요 결과

  • 가장 능력 있는 GPT 모델인 text-davinci-003는 530개의 MCQ에서 총 정확도 65.5%를 기록하였으며, 이는 23.4% 자카르 유사도 기준보다 유의미하게 높았다.
  • 코드 스니펫을 포함한 MCQ는 59.5%의 정확도로 자연어 전용 MCQ의 77.9%보다 훨씬 낮았다.
  • 빈칸 채우기 또는 문장 완성 문제는 가장 잘 처리되었으며(정확도 87.1%), 이는 강력한 패턴 매칭 및 완성 능력을 보여주었다.
  • 출력 예측이나 실행에 대한 진위 문장 식별과 같은 코드 동작에 대한 추론이 요구되는 MCQ는 오직 56.6%의 정확도를 기록하여 실행 시뮬레이션의 핵심적 한계를 드러냈다.
  • 코드와 비코드 MCQ 간 성능 격차는 GPT 모델이 제어 흐름과 데이터 흐름의 정신적 시뮬레이션을 수행하는 데 어려움을 겪고 있음을 시사하며, 이는 코드를 설명하거나 생성하는 데는 잘 작동하지만 실행 추적 기반 추론 작업에서는 실패한다는 것을 의미한다.
  • 강력한 코드 설명 및 생성 능력에도 불구하고, GPT 모델은 추적 기반 추론이 요구되는 작업에서 실패하며, 이는 코드에 대한 그들의 동작 이해에 중요한 격차가 있음을 시사한다.
Figure 2: Distribution of MCQs into categories. Note that the MCQs asking about the output of a code snippet as well as MCQs focused on filling-in the blanks in a snippet are not present in the MCQs with no code. This is to be expected given the nature of those questions. The MCQs with code are quit
Figure 2: Distribution of MCQs into categories. Note that the MCQs asking about the output of a code snippet as well as MCQs focused on filling-in the blanks in a snippet are not present in the MCQs with no code. This is to be expected given the nature of those questions. The MCQs with code are quit

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.