Debugging a faulty program can be frustrating, so why not let AI do it for you? That’s what a developer called “BioBootloader” did by creating Wolverine, a program that can give Python programs “regenerative healing capabilities,” Hackaday reports. (Yes, just like the Marvel superhero.)
“Run your scripts with it and if they crash, GPT-4 edits them and explains what went wrong,” BioBootloader wrote in a tweet that accompanied a demonstration video. “Even if you have a lot of bugs, it will be rerun repeatedly until everything is fixed.”
GPT-4 is a multimodal AI language model created by OpenAI and released in March, available to ChatGPT Plus subscribers and in API form for beta testers. It uses its “knowledge” about billions of documents, books, and websites pulled from the Internet to perform word processing tasks such as composition, language translation, and programming.
Today I used GPT-4 to create “Wolverine” – it gives your python scripts regenerative healing abilities!
Run your scripts with them and when they crash, GPT-4 edits them and explains what went wrong. Even if you have a lot of bugs, it will be rerun repeatedly until everything is fixed pic.twitter.com/gN0X7pA2M2
— BioBootloader (@bio_bootloader) March 18, 2023
In the demo video for Wolverine, BioBootloader shows a side-by-side window view, with Python code on the left and Wolverine results on the right in a terminal. He loads a custom calculator script into which he purposely adds a few bugs and then runs it.
“It runs it, it sees the crash, but then it starts talking to GPT-4 to try and figure out how to fix it,” he says. GPT-4 returns an explanation of the program’s errors, shows the changes it is trying to make, and then reruns the program. When seeing new errors, GPT-4 repairs the code again and it works correctly. In the end, the original Python file contains the changes added by GPT-4.
The code is available on GitHub, and the developer says the technique can be applied to other programming languages. Using Wolverine requires an OpenAI API key for GPT-3.5 or GPT-4 and there is a charge for use. At this time, the GPT 3.5 API is open to anyone with an OpenAI account, but GPT-4 access is still restricted by a waiting list.
Recently, several experiments with GPT-4 in recursive loops, such as Auto-GPT and BabyAGI, have attempted to give GPT-4 more “agentic” capabilities that allow it to run more GPT-4 instances (agents) to perform several tasks simultaneously. conduct or act autonomously.
While currently primitive proof-of-concept, techniques like Wolverine illustrate a possible future where apps can fix their own bugs, even unexpected bugs that may crop up after implementation. Of course, the implications, safety, and wisdom of making that happen haven’t been fully explored yet.