Fixing Hardware Security Bugs with Large Language Models

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Ahmad, Baleegh, Thakur, Shailja, Tan, Benjamin, Karri, Ramesh, Pearce, Hammond
Format: Preprint
Publié: 2023
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914789195776000
author Ahmad, Baleegh
Thakur, Shailja
Tan, Benjamin
Karri, Ramesh
Pearce, Hammond
author_facet Ahmad, Baleegh
Thakur, Shailja
Tan, Benjamin
Karri, Ramesh
Pearce, Hammond
contents Novel AI-based code-writing Large Language Models (LLMs) such as OpenAI's Codex have demonstrated capabilities in many coding-adjacent domains. In this work we consider how LLMs maybe leveraged to automatically repair security relevant bugs present in hardware designs. We focus on bug repair in code written in the Hardware Description Language Verilog. For this study we build a corpus of domain-representative hardware security bugs. We then design and implement a framework to quantitatively evaluate the performance of any LLM tasked with fixing the specified bugs. The framework supports design space exploration of prompts (i.e., prompt engineering) and identifying the best parameters for the LLM. We show that an ensemble of LLMs can repair all ten of our benchmarks. This ensemble outperforms the state-of-the-art Cirfix hardware bug repair tool on its own suite of bugs. These results show that LLMs can repair hardware security bugs and the framework is an important step towards the ultimate goal of an automated end-to-end bug repair framework.
format Preprint
id arxiv_https___arxiv_org_abs_2302_01215
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Fixing Hardware Security Bugs with Large Language Models
Ahmad, Baleegh
Thakur, Shailja
Tan, Benjamin
Karri, Ramesh
Pearce, Hammond
Cryptography and Security
Novel AI-based code-writing Large Language Models (LLMs) such as OpenAI's Codex have demonstrated capabilities in many coding-adjacent domains. In this work we consider how LLMs maybe leveraged to automatically repair security relevant bugs present in hardware designs. We focus on bug repair in code written in the Hardware Description Language Verilog. For this study we build a corpus of domain-representative hardware security bugs. We then design and implement a framework to quantitatively evaluate the performance of any LLM tasked with fixing the specified bugs. The framework supports design space exploration of prompts (i.e., prompt engineering) and identifying the best parameters for the LLM. We show that an ensemble of LLMs can repair all ten of our benchmarks. This ensemble outperforms the state-of-the-art Cirfix hardware bug repair tool on its own suite of bugs. These results show that LLMs can repair hardware security bugs and the framework is an important step towards the ultimate goal of an automated end-to-end bug repair framework.
title Fixing Hardware Security Bugs with Large Language Models
topic Cryptography and Security
url https://arxiv.org/abs/2302.01215