Dai, Zhenlong
Less is More: Adaptive Program Repair with Bug Localization and Preference Learning
Dai, Zhenlong, Chen, Bingrui, Zhao, Zhuoluo, Tang, Xiu, Wu, Sai, Yao, Chang, Gao, Zhipeng, Chen, Jingyuan
Automated Program Repair (APR) is a task to automatically generate patches for the buggy code. However, most research focuses on generating correct patches while ignoring the consistency between the fixed code and the original buggy code. How to conduct adaptive bug fixing and generate patches with minimal modifications have seldom been investigated. To bridge this gap, we first introduce a novel task, namely AdaPR (Adaptive Program Repair). We then propose a two-stage approach AdaPatcher (Adaptive Patch Generator) to enhance program repair while maintaining the consistency. In the first stage, we utilize a Bug Locator with self-debug learning to accurately pinpoint bug locations. In the second stage, we train a Program Modifier to ensure consistency between the post-modified fixed code and the pre-modified buggy code. The Program Modifier is enhanced with a location-aware repair learning strategy to generate patches based on identified buggy lines, a hybrid training strategy for selective reference and an adaptive preference learning to prioritize fewer changes. The experimental results show that our approach outperforms a set of baselines by a large margin, validating the effectiveness of our two-stage framework for the newly proposed AdaPR task.
MPCODER: Multi-user Personalized Code Generator with Explicit and Implicit Style Representation Learning
Dai, Zhenlong, Yao, Chang, Han, WenKang, Yuan, Ying, Gao, Zhipeng, Chen, Jingyuan
Recent researchers have explored code generation Nowadays, LLMs have been successfully used to task by using LLMs; however, most studies (Li support developers' daily development, such as et al., 2023b, 2022a; Ahmad et al., 2021; Hu et al., code generation, test generation, etc. However, 2021) focus on generating "correct" code. There existing Code LLMs are usually general models is limited research investigating how to generate trained with large programming corpus (Zheng "personalized" code, especially for multi-user personalization, et al., 2023; Chen et al., 2022), therefore the generated with no research conducted yet. Automatically code is difficult to adapt to personalized and/or generating code according to developers' customized requests. Consider the following practical preferences or projects' consistency is a challenging scenarios: Alice is a software developer. To task: (i) Considering different programmers improve programmers' daily efficiency, her company have their own coding styles, it is too expensive provided the base LLMs that can be used for to fine-tune an LLM for each user (Guo et al., code generation.