CigaR: Cost-efficient Program Repair with LLMs

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Hidvégi, Dávid, Etemadi, Khashayar, Bobadilla, Sofia, Monperrus, Martin
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866913426108841984
author Hidvégi, Dávid
Etemadi, Khashayar
Bobadilla, Sofia
Monperrus, Martin
author_facet Hidvégi, Dávid
Etemadi, Khashayar
Bobadilla, Sofia
Monperrus, Martin
contents Large language models (LLM) have proven to be effective at automated program repair (APR). However, using LLMs can be costly, with companies invoicing users by the number of tokens. In this paper, we propose CigaR, the first LLM-based APR tool that focuses on minimizing the repair cost. CigaR works in two major steps: generating a first plausible patch and multiplying plausible patches. CigaR optimizes the prompts and the prompt setting to maximize the information given to LLMs using the smallest possible number of tokens. Our experiments on 429 bugs from the widely used Defects4J and HumanEval-Java datasets shows that CigaR reduces the token cost by 73%. On average, CigaR spends 127k tokens per bug while the baseline uses 467k tokens per bug. On the subset of bugs that are fixed by both, CigaR spends 20k per bug while the baseline uses 608k tokens, a cost saving of 96%. Our extensive experiments show that CigaR is a cost-effective LLM-based program repair tool that uses a low number of tokens to automatically generate patches.
format Preprint
id arxiv_https___arxiv_org_abs_2402_06598
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle CigaR: Cost-efficient Program Repair with LLMs
Hidvégi, Dávid
Etemadi, Khashayar
Bobadilla, Sofia
Monperrus, Martin
Software Engineering
Machine Learning
Large language models (LLM) have proven to be effective at automated program repair (APR). However, using LLMs can be costly, with companies invoicing users by the number of tokens. In this paper, we propose CigaR, the first LLM-based APR tool that focuses on minimizing the repair cost. CigaR works in two major steps: generating a first plausible patch and multiplying plausible patches. CigaR optimizes the prompts and the prompt setting to maximize the information given to LLMs using the smallest possible number of tokens. Our experiments on 429 bugs from the widely used Defects4J and HumanEval-Java datasets shows that CigaR reduces the token cost by 73%. On average, CigaR spends 127k tokens per bug while the baseline uses 467k tokens per bug. On the subset of bugs that are fixed by both, CigaR spends 20k per bug while the baseline uses 608k tokens, a cost saving of 96%. Our extensive experiments show that CigaR is a cost-effective LLM-based program repair tool that uses a low number of tokens to automatically generate patches.
title CigaR: Cost-efficient Program Repair with LLMs
topic Software Engineering
Machine Learning
url https://arxiv.org/abs/2402.06598