Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Dilhara, Malinda, Bellur, Abhiram, Bryksin, Timofey, Dig, Danny
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916288181305344
author Dilhara, Malinda
Bellur, Abhiram
Bryksin, Timofey
Dig, Danny
author_facet Dilhara, Malinda
Bellur, Abhiram
Bryksin, Timofey
Dig, Danny
contents Software developers often repeat code changes, known as "code change patterns" (CPATs), within and across projects. Automating these CPATs accelerates development, but current Transformation by Example (TBE) techniques are limited by the input examples' quality and quantity, missing variations with different syntax or flow yet semantically similar. Large Language Models (LLMs), trained on vast code datasets, can overcome these limitations by generating semantically equivalent, unseen CPAT variants, enhancing TBE effectiveness. We identified best practices for using LLMs to generate code variants meeting criteria of correctness, usefulness, and applicability. Implementing these in PyCraft, combining static and dynamic analysis with LLMs, we achieved an F-measure of 96.6% in identifying correct variants, expanding inputs by 58x on average, and automating changes to increase target codes by up to 39x. Patches from PyCraft were submitted to projects like microsoft/DeepSpeed and IBM/inFairness, with an 83% acceptance rate, validating our approach's usefulness.
format Preprint
id arxiv_https___arxiv_org_abs_2402_07138
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example
Dilhara, Malinda
Bellur, Abhiram
Bryksin, Timofey
Dig, Danny
Software Engineering
Software developers often repeat code changes, known as "code change patterns" (CPATs), within and across projects. Automating these CPATs accelerates development, but current Transformation by Example (TBE) techniques are limited by the input examples' quality and quantity, missing variations with different syntax or flow yet semantically similar. Large Language Models (LLMs), trained on vast code datasets, can overcome these limitations by generating semantically equivalent, unseen CPAT variants, enhancing TBE effectiveness. We identified best practices for using LLMs to generate code variants meeting criteria of correctness, usefulness, and applicability. Implementing these in PyCraft, combining static and dynamic analysis with LLMs, we achieved an F-measure of 96.6% in identifying correct variants, expanding inputs by 58x on average, and automating changes to increase target codes by up to 39x. Patches from PyCraft were submitted to projects like microsoft/DeepSpeed and IBM/inFairness, with an 83% acceptance rate, validating our approach's usefulness.
title Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example
topic Software Engineering
url https://arxiv.org/abs/2402.07138