ABSTRACT Automated program repair (APR) aims to automatically detect and fix software defects, thereby improving software reliability and reducing debugging effort. Recently, researchers have explored the retrieval augmentation techniques to enhance large code models' performance in program repair. Existing retrieval augmentation models often inject retrieved information at the input layer, which can lead to input sequence inflation and interfere with the encoder's ability to focus on the core repair task. Meanwhile, learning‐based methods frequently produce unreliable patches, lacking mechanisms to verify or refine low‐confidence outputs during generation. To address these challenges, this paper proposes RADI‐PR, a novel approach that integrates retrieval augmentation and decoding intervention at the model's output layer. RADI‐PR dynamically incorporates relevant repair patterns based on historical fixes and intervenes in low‐confidence generations to enhance both the accuracy and reliability of generated patches. Comprehensive evaluations on four benchmark datasets, including Java, FixJS, Codeflaws and TSSB‐3 M, show that RADI‐PR consistently outperforms baseline methods. RADI‐PR achieves improvements of up to 5.5% in Precision, 3.2% in F1‐score and 2.2% in Accuracy.
Wang et al. (Fri,) studied this question.