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 条
  • [31] EMG: A Domain-Specific Transformation Language for Synthetic Model Generation
    Popoola, Saheed
    Kolovos, Dimitrios S.
    Rodriguez, Horacio Hoyos
    THEORY AND PRACTICE OF MODEL TRANSFORMATIONS, ICMT 2016, 2016, 9765 : 36 - 51
  • [32] Augmenting Large Language Models with Rules for Enhanced Domain-Specific Interactions: The Case of Medical Diagnosis
    Panagoulias, Dimitrios P.
    Virvou, Maria
    Tsihrintzis, George A.
    ELECTRONICS, 2024, 13 (02)
  • [33] Runtime code generation in C++ as a foundation for domain-specific optimisation
    Beckmann, O
    Houghton, A
    Mellor, M
    Kelly, PHJ
    DOMAIN-SPECIFIC PROGRAM GENERATION, 2003, 3016 : 291 - 306
  • [34] A Domain-Specific Language for Microservices
    Donham, Jacob
    PROCEEDINGS OF THE 9TH ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON SCALA (SCALA '18), 2018, : 2 - 12
  • [35] A Domain-specific Language for Automated Fault Injection in SystemC Models
    Lohmann, Douglas
    Huf, Alexis
    Lettnin, Djones
    Siqueira, Frank
    Guntzel, Jose Luis
    2018 25TH IEEE INTERNATIONAL CONFERENCE ON ELECTRONICS, CIRCUITS AND SYSTEMS (ICECS), 2018, : 425 - 428
  • [36] Architecture and Language for Semantic Reduction of Domain-Specific Models in BPMS
    Lace, Lelde
    Liepins, Renars
    Rencis, Edgars
    PERSPECTIVES IN BUSINESS INFORMATICS RESEARCH, BIR 2012, 2012, 128 : 70 - 84
  • [37] A Graph Solver for the Automated Generation of Consistent Domain-Specific Models
    Semerath, Oszkar
    Nagy, Andras Szabolcs
    Varro, Daniel
    PROCEEDINGS 2018 IEEE/ACM 40TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2018, : 969 - 980
  • [38] From Domain-Specific Language to Code: Smart Contracts and the Application of Design Patterns
    Woehrer, Maximilian
    Zdun, Uwe
    IEEE SOFTWARE, 2020, 37 (05) : 37 - 42
  • [39] A Domain-Specific Language for Aviation Domain Interoperability
    Comitz, Paul
    2013 INTEGRATED COMMUNICATIONS, NAVIGATION AND SURVEILLANCE CONFERENCE (ICNS), 2013,
  • [40] JAMOOS: A domain-specific language for language processing
    Gil, Joseph Yossi
    Tsoglin, Yuri
    2001, University of Zagreb, Faculty of Political Sciences (09)