Improving Natural Language Capability of Code Large Language Model

Wei Li,Daoguang Zan,Bei Guan,Ailun Yu,Xiaolin Chen,Yongji Wang
2024-01-25
Abstract:Code large language models (Code LLMs) have demonstrated remarkable performance in code generation. Nonetheless, most existing works focus on boosting code LLMs from the perspective of programming capabilities, while their natural language capabilities receive less attention. To fill this gap, we thus propose a novel framework, comprising two modules: AttentionExtractor, which is responsible for extracting key phrases from the user's natural language requirements, and AttentionCoder, which leverages these extracted phrases to generate target code to solve the requirement. This framework pioneers an innovative idea by seamlessly integrating code LLMs with traditional natural language processing tools. To validate the effectiveness of the framework, we craft a new code generation benchmark, called MultiNL-H, covering five natural languages. Extensive experimental results demonstrate the effectiveness of our proposed framework.
Computation and Language
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: Existing Code Large Language Models (Code LLMs) perform well in code generation, but most research efforts mainly focus on enhancing the programming capabilities of these models, with less attention paid to natural language understanding capabilities. This has led to significant differences in the performance of models when handling code - generation tasks in multi - natural - language environments, especially performing poorly in non - English language environments. Therefore, the paper proposes a new framework aimed at improving the code - generation capabilities of Code LLMs by enhancing their understanding of natural - language contexts, especially in multiple natural - language environments. Specifically, the paper proposes a framework consisting of two modules: 1. **AttentionExtractor**: Responsible for extracting key phrases from users' natural - language requirements. 2. **AttentionCoder**: Utilizes these extracted key phrases to generate target code to meet the requirements. In addition, the paper also constructs a new code - generation benchmark set **MultiNL - H**, covering five natural languages (English, Chinese, French, Japanese, and Spanish), to verify the effectiveness of the proposed framework. Through extensive experimental results, the paper demonstrates the effectiveness and superiority of this framework in multiple natural - language environments. For example, by using **AttentionExtractor** and **AttentionCoder**, the paper successfully improves the code - generation performance of OpenAI's GPT - 3.5 - turbo on Chinese tasks, with an absolute improvement of more than 10% in the pass rate.