RAPGen: An Approach for Fixing Code Inefficiencies in Zero-Shot

06/29/2023
by   Spandan Garg, et al.
0

Performance bugs are non-functional bugs that can even manifest in well-tested commercial products. Fixing these performance bugs is an important yet challenging problem. In this work, we address this challenge and present a new approach called Retrieval-Augmented Prompt Generation (RAPGen). Given a code snippet with a performance issue, RAPGen first retrieves a prompt instruction from a pre-constructed knowledge-base of previous performance bug fixes and then generates a prompt using the retrieved instruction. It then uses this prompt on a Large Language Model (such as Codex) in zero-shot to generate a fix. We compare our approach with the various prompt variations and state of the art methods in the task of performance bug fixing. Our evaluation shows that RAPGen can generate performance improvement suggestions equivalent or better than a developer in  60 an expert-verified dataset of past performance changes made by C# developers.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/11/2022

Using Developer Discussions to Guide Fixing Bugs in Software

Automatically fixing software bugs is a challenging task. While recent w...
research
12/08/2022

Explaining Software Bugs Leveraging Code Structures in Neural Machine Translation

Software bugs claim approximately 50 economy billions of dollars. Once a...
research
08/23/2023

Bugsplainer: Leveraging Code Structures to Explain Software Bugs with Neural Machine Translation

Software bugs cost the global economy billions of dollars each year and ...
research
03/21/2022

CLIP meets GamePhysics: Towards bug identification in gameplay videos using zero-shot transfer learning

Gameplay videos contain rich information about how players interact with...
research
05/23/2023

GrACE: Generation using Associated Code Edits

Developers expend a significant amount of time in editing code for a var...
research
02/07/2022

μAFL: Non-intrusive Feedback-driven Fuzzing for Microcontroller Firmware

Fuzzing is one of the most effective approaches to finding software flaw...
research
10/05/2022

Large Language Models are Pretty Good Zero-Shot Video Game Bug Detectors

Video game testing requires game-specific knowledge as well as common se...

Please sign up or login with your details

Forgot password? Click here to reset