On the Effectiveness of Large Language Models in Domain-Specific Code Generation

被引:1
|
作者
Gu, Xiaodong [1 ]
Chen, Meng [1 ]
Lin, Yalan [1 ]
Hu, Yuhan [1 ]
Zhang, Hongyu [2 ]
Wan, Chengcheng [3 ]
Wei, Zhao [4 ]
Xu, Yong [4 ]
Wang, Juhong [4 ]
机构
[1] Shanghai Jiao Tong Univ, Shanghai, Peoples R China
[2] Chongqing Univ, Chongqing, Peoples R China
[3] East China Normal Univ, Shanghai, Peoples R China
[4] Tencent Inc, Beijing, Peoples R China
基金
中国国家自然科学基金; 国家重点研发计划;
关键词
large language models; code generation; domain-specific program generation;
D O I
10.1145/3697012
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Large language models (LLMs) such as ChatGPT have shown remarkable capabilities in code generation. Despite significant achievements, they rely on enormous training data to acquire a broad spectrum of open domain knowledge. Besides, their evaluation revolves around open-domain benchmarks like HumanEval, which primarily consist of programming contests. Therefore, it is hard to fully characterize the intricacies and challenges associated with particular domains (e.g., Web, game, and math). In this article, we conduct an in-depth study of the LLMs in domain-specific code generation. Our results demonstrate that LLMs exhibit sub-optimal performance in generating domain-specific code, due to their limited proficiency in utilizing domain-specific libraries. We further observe that incorporating API knowledge as prompts can empower LLMs to generate more professional code. Based on these findings, we further investigate how to effectively incorporate API knowledge into the code generation process. We experiment with three strategies for incorporating domain knowledge, namely, external knowledge inquirer, chain-of-thought prompting, and chain-of-thought fine-tuning. We refer to these strategies as a new code generation approach called DomCoder. Experimental results show that all strategies of DomCoder improve the effectiveness of domain-specific code generation under certain settings.
引用
收藏
页数:22
相关论文
共 50 条
  • [1] Grammar Prompting for Domain-Specific Language Generation with Large Language Models
    Wang, Bailin
    Wang, Zi
    Wang, Xuezhi
    Cao, Yuan
    Saurous, Rif A.
    Kim, Yoon
    ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 36 (NEURIPS 2023), 2023,
  • [2] MPIRIGEN: MPI Code Generation through Domain-Specific Language Models
    Schneider, Nadav
    Hasabnis, Niranjan
    Vo, Vy A.
    Kadosh, Tal
    Krien, Neva
    Capota, Mihai
    Tamir, Guy
    Willke, Ted
    Ahmed, Nesreen
    Pinter, Yuval
    Mattson, Timothy
    Oren, Gal
    PROCEEDINGS OF THE 2024 ON WORKSHOP ON AI FOR SYSTEMS, AI4SYS 2024, 2024, : 1 - 6
  • [3] An Evaluation of Domain-Specific Language Technologies for Code Generation
    Schmittt, Christian
    Kuckuk, Sebastian
    Kostlert, Harald
    Hannig, Frank
    Teich, Jurgen
    2014 14TH INTERNATIONAL CONFERENCE ON COMPUTATIONAL SCIENCE AND ITS APPLICATIONS (ICCSA), 2014, : 18 - 26
  • [4] Domain-specific language for automatic generation of UML models
    Miranda, Marcio Assis
    Ribeiro, Marcos Guilherme
    Marques-Neto, Humberto Torres
    Junho Song, Mark Alan
    IET SOFTWARE, 2018, 12 (02) : 129 - 135
  • [5] Domain-specific language for infrastructure as code
    Shvetcova, Valeriya
    Borisenko, Oleg
    Polischuk, Maxim
    2019 IVANNIKOV MEMORIAL WORKSHOP (IVMEM 2019), 2019, : 39 - 45
  • [6] Large language models as oracles for instantiating ontologies with domain-specific knowledge
    Ciatto, Giovanni
    Agiollo, Andrea
    Magnini, Matteo
    Omicini, Andrea
    KNOWLEDGE-BASED SYSTEMS, 2025, 310
  • [7] FAMILIAR: A domain-specific language for large scale management of feature models
    Acher, Mathieu
    Collet, Philippe
    Lahire, Philippe
    France, Robert B.
    SCIENCE OF COMPUTER PROGRAMMING, 2013, 78 (06) : 657 - 681
  • [8] Generating Domain-Specific Programs for Diagram Authoring with Large Language Models
    Jain, Rijul
    Ni, Wode
    Sunshine, Joshua
    COMPANION PROCEEDINGS OF THE 2023 ACM SIGPLAN INTERNATIONAL CONFERENCE ON SYSTEMS, PROGRAMMING, LANGUAGES, AND APPLICATIONS: SOFTWARE FOR HUMANITY, SPLASH COMPANION 2023, 2023, : 70 - 71
  • [9] A Domain-Specific Language for Automatic Generation of Checkers
    Hadiwijaya, Ryan Ignatius
    Liem, M. M. Inggriani
    2015 INTERNATIONAL CONFERENCE ON DATA AND SOFTWARE ENGINEERING (ICODSE), 2015, : 7 - 12
  • [10] Generation of high-performance code based on a domain-specific language for algorithmic skeletons
    Wrede, Fabian
    Rieger, Christoph
    Kuchen, Herbert
    JOURNAL OF SUPERCOMPUTING, 2020, 76 (07): : 5098 - 5116