Unveiling the Role of GPT-4 in Solving LeetCode Programming Problems

IF 2.2 3区 工程技术 Q3 COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS Computer Applications in Engineering Education Pub Date : 2025-01-05 DOI:10.1002/cae.22815
Sarthak Vishnu,  Sahil, Naman Garg
{"title":"Unveiling the Role of GPT-4 in Solving LeetCode Programming Problems","authors":"Sarthak Vishnu,&nbsp; Sahil,&nbsp;Naman Garg","doi":"10.1002/cae.22815","DOIUrl":null,"url":null,"abstract":"<div>\n \n <p>The landscape of programming education is undergoing a transformative shift in the era of AI and machine learning. This research delves into the role of GPT-4, a state-of-the-art language model, in solving intermediate-level programming problems, focusing on the renowned LeetCode platform. For this, the work employs different programming problems from two LeetCode contests, providing a comprehensive evaluation of GPT-4's capabilities. The results reveal intriguing patterns in the model's behavior. Initial attempts, when provided with all inputs simultaneously, exhibit high accuracy, but subsequent attempts show consistent fluctuations, rarely surpassing the accuracy of the first attempt. Upon closer examination, a distinct pattern emerges in GPT-4's problem-solving approach, where the model iteratively refines its solutions, incorporating corrections in subsequent attempts. However, the lack of a historical context for past attempts raises questions about the model's attention span and its ability to rectify mistakes. Notably, GPT-4 consistently fails on the same test case with the same generated output, suggesting a potential limitation in addressing specific challenges. But, on leveraging human assistance to AI tools, the observations and patterns from the incorrect codes can be drawn and required adjustments to rectify the codes can be made. A direct result of this is observed in the increased success rate in problem-solving by students, rising from 68% in the moderate learning stage to 92% in the advanced learning stage. Hence, the presented work proposes a human-supervised methodology to leverage the AI-assisted code generation and employs that in improving the effectiveness of AI-assisted teaching–learning process.</p>\n </div>","PeriodicalId":50643,"journal":{"name":"Computer Applications in Engineering Education","volume":"33 1","pages":""},"PeriodicalIF":2.2000,"publicationDate":"2025-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Applications in Engineering Education","FirstCategoryId":"5","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1002/cae.22815","RegionNum":3,"RegionCategory":"工程技术","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
引用次数: 0

Abstract

The landscape of programming education is undergoing a transformative shift in the era of AI and machine learning. This research delves into the role of GPT-4, a state-of-the-art language model, in solving intermediate-level programming problems, focusing on the renowned LeetCode platform. For this, the work employs different programming problems from two LeetCode contests, providing a comprehensive evaluation of GPT-4's capabilities. The results reveal intriguing patterns in the model's behavior. Initial attempts, when provided with all inputs simultaneously, exhibit high accuracy, but subsequent attempts show consistent fluctuations, rarely surpassing the accuracy of the first attempt. Upon closer examination, a distinct pattern emerges in GPT-4's problem-solving approach, where the model iteratively refines its solutions, incorporating corrections in subsequent attempts. However, the lack of a historical context for past attempts raises questions about the model's attention span and its ability to rectify mistakes. Notably, GPT-4 consistently fails on the same test case with the same generated output, suggesting a potential limitation in addressing specific challenges. But, on leveraging human assistance to AI tools, the observations and patterns from the incorrect codes can be drawn and required adjustments to rectify the codes can be made. A direct result of this is observed in the increased success rate in problem-solving by students, rising from 68% in the moderate learning stage to 92% in the advanced learning stage. Hence, the presented work proposes a human-supervised methodology to leverage the AI-assisted code generation and employs that in improving the effectiveness of AI-assisted teaching–learning process.

查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
揭示GPT-4在解决LeetCode编程问题中的作用
在人工智能和机器学习时代,编程教育的格局正在发生革命性的变化。本研究以著名的LeetCode平台为重点,深入探讨了GPT-4这一最先进的语言模型在解决中级编程问题中的作用。为此,这项工作采用了两次LeetCode竞赛中的不同编程问题,对GPT-4的能力进行了全面评估。结果揭示了模型行为中有趣的模式。当同时提供所有输入时,最初的尝试显示出很高的准确性,但随后的尝试显示出持续的波动,很少超过第一次尝试的准确性。经过仔细检查,在GPT-4的解决问题的方法中出现了一个独特的模式,其中模型迭代地改进其解决方案,并在随后的尝试中纳入修正。然而,过去的尝试缺乏历史背景,这让人们对该模型的注意力持续时间和纠正错误的能力产生了质疑。值得注意的是,GPT-4在相同的测试用例和相同的生成输出中始终失败,这表明在解决特定挑战方面存在潜在的局限性。但是,利用人工智能工具的人工辅助,可以从错误的代码中得出观察和模式,并可以进行必要的调整以纠正代码。这样做的一个直接结果是学生解决问题的成功率提高了,从中等学习阶段的68%上升到高级学习阶段的92%。因此,本文提出了一种人类监督的方法来利用人工智能辅助的代码生成,并将其用于提高人工智能辅助教学过程的有效性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
Computer Applications in Engineering Education
Computer Applications in Engineering Education 工程技术-工程:综合
CiteScore
7.20
自引率
10.30%
发文量
100
审稿时长
6-12 weeks
期刊介绍: Computer Applications in Engineering Education provides a forum for publishing peer-reviewed timely information on the innovative uses of computers, Internet, and software tools in engineering education. Besides new courses and software tools, the CAE journal covers areas that support the integration of technology-based modules in the engineering curriculum and promotes discussion of the assessment and dissemination issues associated with these new implementation methods.
期刊最新文献
Research on the Concrete Teaching of Abstract Theories in the “Fundamentals of Mechanical Engineering Control” Course Empowered by Generative Artificial Intelligence Research on the Concrete Teaching of Abstract Theories in the “Fundamentals of Mechanical Engineering Control” Course Empowered by Generative Artificial Intelligence Artificial Intelligence and Responsible Adoption in Engineering Education: Evidence, Concerns, and a Constructive Path Forward Artificial Intelligence and Responsible Adoption in Engineering Education: Evidence, Concerns, and a Constructive Path Forward Towards the Integration of Remote Laboratories in Massive Open Online Courses: Insights from Usage Logs and Student Feedback
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1