RWKV-based Encoder-Decoder Model for Code Completion
Lu Zhou, Zhonglin Xiao, Zhipeng Ning · 2023
Intelligent code completion techniques, which offer code suggestions, are essential for assisting programmers in reducing errors and improving programming efficiency. Traditional Recurrent Neural Networks (RNNs) face challenges in terms of training efficiency, representation performance, and architecture extensibility. We introduce RWKV, the latest parallel trainable RNN architecture, to tackle these challenges. Additionally, we propose a new code completion model that leverages RWKV. The model utilizes an encoder-decoder framework to optimize the use of temporal and structural aspects of the code. It learns the mapping between the concrete syntax tree of the source code and the source code to identify exceptional correspondences. This approach leads to more accurate complementation outcomes. Based on experimental results, our model outperforms the baseline model in three metrics: Accuracy, EM, and Edit Sim.