Evolutionary Computation-enhanced Large Language Models for Intelligent Code Completion
提出进化双通道网络框架,结合大语言模型的语义理解与进化计算的全局优化能力,通过遗传算法优化抽象语法树节点预测,提升代码补全的准确性和可解释性。
Code completion is a context-aware code completion function available in certain programming environments. It can accelerate the coding process of applications, enhance development efficiency, and reduce costs. Compared with the code generation, code completion has advantages such as flexible adaptation to changes, high precision and pertinence, and lower performance overhead. Intelligent code completion uses artificial intelligence technology to achieve code completion more effectively. However, it faces issues such as poor interpretability, unstable performance, and high demand for computing resources. To make full use of the powerful semantic understanding, information retrieval, and text generation capabilities of Large Language Models (LLMs), as well as the strong global optimization and adaptive search capabilities of Evolutionary Computation (EC), an integrated network framework, the Evolutionary Dual-Channel Network (EDN), is proposed. EDN leverages the precise context comprehension and feature extraction capabilities of large language models to predict the nodes of the abstract syntax tree, thereby achieving code completion. To enhance the performance and interpretability of the entire framework, we use the genetic algorithm (GA), with its powerful search ability, as the main optimization method for EDN. This proposed framework combining LLMs and EC in a novel way. By using EC to optimize certain components in the network framework of LLMs, it enables a more flexible integration of LLMs and EC. Experiment results on three public corpora consisting of multiple programming languages demonstrate the effectiveness of the proposed method.