Automated Repair of AI Code with Large Language Models and Formal Verification

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Charalambous, Yiannis, Manino, Edoardo, Cordeiro, Lucas C.
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866917666523971584
author Charalambous, Yiannis
Manino, Edoardo
Cordeiro, Lucas C.
author_facet Charalambous, Yiannis
Manino, Edoardo
Cordeiro, Lucas C.
contents The next generation of AI systems requires strong safety guarantees. This report looks at the software implementation of neural networks and related memory safety properties, including NULL pointer deference, out-of-bound access, double-free, and memory leaks. Our goal is to detect these vulnerabilities, and automatically repair them with the help of large language models. To this end, we first expand the size of NeuroCodeBench, an existing dataset of neural network code, to about 81k programs via an automated process of program mutation. Then, we verify the memory safety of the mutated neural network implementations with ESBMC, a state-of-the-art software verifier. Whenever ESBMC spots a vulnerability, we invoke a large language model to repair the source code. For the latest task, we compare the performance of various state-of-the-art prompt engineering techniques, and an iterative approach that repeatedly calls the large language model.
format Preprint
id arxiv_https___arxiv_org_abs_2405_08848
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Automated Repair of AI Code with Large Language Models and Formal Verification
Charalambous, Yiannis
Manino, Edoardo
Cordeiro, Lucas C.
Software Engineering
Artificial Intelligence
The next generation of AI systems requires strong safety guarantees. This report looks at the software implementation of neural networks and related memory safety properties, including NULL pointer deference, out-of-bound access, double-free, and memory leaks. Our goal is to detect these vulnerabilities, and automatically repair them with the help of large language models. To this end, we first expand the size of NeuroCodeBench, an existing dataset of neural network code, to about 81k programs via an automated process of program mutation. Then, we verify the memory safety of the mutated neural network implementations with ESBMC, a state-of-the-art software verifier. Whenever ESBMC spots a vulnerability, we invoke a large language model to repair the source code. For the latest task, we compare the performance of various state-of-the-art prompt engineering techniques, and an iterative approach that repeatedly calls the large language model.
title Automated Repair of AI Code with Large Language Models and Formal Verification
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2405.08848