ChatGPT is Now Fixing Bugs in Code

ODSC - Open Data Science
3 min readFeb 9, 2023

Since its public introduction, ChatGPT has become a game-changer for many workers. Often used as an extension of the worker, research associate, or both, OpenAI’s chatbot has found countless uses among its many users. Now, a new and interesting use for ChatGPT has emerged. Researchers from Johannes Gutenberg University and University College London have written a paper on how ChatGPT can weed out errors with sample code. But not only that, as it has been found to improve upon the code.

So you might ask, how did the team accomplish this? According to the paper, they gave ChatGPT 40 pieces of buggy code. But to test this out further, they also had other code-fixing programs to do the same: Codex, CoCoNut, and Standard ARP. Turning to ChatGPT, they asked it what was wrong with the imputed code and then put it in the chat box. When compared to the other systems, ChatGPT was able to perform on par with the other systems, solving 19 problems. In comparison, Standard ARP solved 7, CoCoNut solved 19, and Codex solved 21. So, as you can see, it kept up with the other programs well. But this isn’t where ChatGPT shines and that’s when the researchers took it a step further.

See for those who aren’t familiar with the program, it’s the drawn-out back and forth between the user and AI where ChatGPT tends to do its best work. So after returning to ChatGPT and interacting with it by pressing further, the AI was able to solve 31 questions, 10 more than its top rival in this study, Codex. The report goes into further detail, “A powerful advantage of ChatGPT is that we can interact with the system in a dialogue to specify a request in more detail,…We see that for most of our requests, ChatGPT asks for more information about the problem and the bug. By providing such hints to ChatGPT, its success rate can be further increased, fixing 31 out of 40 bugs, outperforming state-of-the-art.

Another advantage of ChatGPT is its ability to interact with the user. As the study states, “ChatGPT seems to have a relatively high variance when fixing bugs,…For an end-user, however, this means that it can be helpful to execute requests multiple times.” This is no surprise. As ODSC reported last week, software engineers at Amazon are actively using ChatGPT as their own coding assistant, though the company has issued a warning through their legal department of this practice. It’s quickly likely that the thread is spreading in the overall software community. If this practice continues, and other workers in industries outside of software engineering begin to use AI as a means to enhance their abilities, then Microsoft’s CEO Satya Nadella’s hopes for AI might come true.

Are you interested in artificial intelligence or are hoping to strengthen your data skills in 2023? Then you won’t want to miss ODSC East’s, featuring over 11 tracks focusing on every aspect of AI, data science, and more.

Originally posted on OpenDataScience.com

Read more data science articles on OpenDataScience.com, including tutorials and guides from beginner to advanced levels! Subscribe to our weekly newsletter here and receive the latest news every Thursday. You can also get data science training on-demand wherever you are with our Ai+ Training platform. Subscribe to our fast-growing Medium Publication too, the ODSC Journal, and inquire about becoming a writer.

--

--

ODSC - Open Data Science

Our passion is bringing thousands of the best and brightest data scientists together under one roof for an incredible learning and networking experience.