Skip to content

Developer creates “self-healing” programs that self-repair thanks to AI

    An AI-generated image of
    Enlarge / An AI-generated and human-curated image of “Wolverine programming on a computer.”

    Benj Edwards / Midreis

    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.

    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.