Asking Clarification Questions for Code Generation in General-Purpose Programming Language. Li, H., Mesgar, M., Martins, A. F. T., & Gurevych, I. 2022. Publisher: arXiv Version Number: 1
Paper doi abstract bibtex Code generation from text requires understanding the user's intent from a natural language description (NLD) and generating an executable program code snippet that satisfies this intent. While recent pretrained language models (PLMs) demonstrate remarkable performance for this task, these models fail when the given NLD is ambiguous due to the lack of enough specifications for generating a high-quality code snippet. In this work, we introduce a novel and more realistic setup for this task. We hypothesize that ambiguities in the specifications of an NLD are resolved by asking clarification questions (CQs). Therefore, we collect and introduce a new dataset named CodeClarQA containing NLD-Code pairs with created CQAs. We evaluate the performance of PLMs for code generation on our dataset. The empirical results support our hypothesis that clarifications result in more precise generated code, as shown by an improvement of 17.52 in BLEU, 12.72 in CodeBLEU, and 7.7\% in the exact match. Alongside this, our task and dataset introduce new challenges to the community, including when and what CQs should be asked.
@article{li_asking_2022,
title = {Asking {Clarification} {Questions} for {Code} {Generation} in {General}-{Purpose} {Programming} {Language}},
copyright = {Creative Commons Attribution 4.0 International},
url = {https://arxiv.org/abs/2212.09885},
doi = {10.48550/ARXIV.2212.09885},
abstract = {Code generation from text requires understanding the user's intent from a natural language description (NLD) and generating an executable program code snippet that satisfies this intent. While recent pretrained language models (PLMs) demonstrate remarkable performance for this task, these models fail when the given NLD is ambiguous due to the lack of enough specifications for generating a high-quality code snippet. In this work, we introduce a novel and more realistic setup for this task. We hypothesize that ambiguities in the specifications of an NLD are resolved by asking clarification questions (CQs). Therefore, we collect and introduce a new dataset named CodeClarQA containing NLD-Code pairs with created CQAs. We evaluate the performance of PLMs for code generation on our dataset. The empirical results support our hypothesis that clarifications result in more precise generated code, as shown by an improvement of 17.52 in BLEU, 12.72 in CodeBLEU, and 7.7{\textbackslash}\% in the exact match. Alongside this, our task and dataset introduce new challenges to the community, including when and what CQs should be asked.},
urldate = {2023-01-06},
author = {Li, Haau-Sing and Mesgar, Mohsen and Martins, André F. T. and Gurevych, Iryna},
year = {2022},
note = {Publisher: arXiv
Version Number: 1},
keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences},
}
Downloads: 0
{"_id":"KcH6hkHADTJNLj9tr","bibbaseid":"li-mesgar-martins-gurevych-askingclarificationquestionsforcodegenerationingeneralpurposeprogramminglanguage-2022","author_short":["Li, H.","Mesgar, M.","Martins, A. F. T.","Gurevych, I."],"bibdata":{"bibtype":"article","type":"article","title":"Asking Clarification Questions for Code Generation in General-Purpose Programming Language","copyright":"Creative Commons Attribution 4.0 International","url":"https://arxiv.org/abs/2212.09885","doi":"10.48550/ARXIV.2212.09885","abstract":"Code generation from text requires understanding the user's intent from a natural language description (NLD) and generating an executable program code snippet that satisfies this intent. While recent pretrained language models (PLMs) demonstrate remarkable performance for this task, these models fail when the given NLD is ambiguous due to the lack of enough specifications for generating a high-quality code snippet. In this work, we introduce a novel and more realistic setup for this task. We hypothesize that ambiguities in the specifications of an NLD are resolved by asking clarification questions (CQs). Therefore, we collect and introduce a new dataset named CodeClarQA containing NLD-Code pairs with created CQAs. We evaluate the performance of PLMs for code generation on our dataset. The empirical results support our hypothesis that clarifications result in more precise generated code, as shown by an improvement of 17.52 in BLEU, 12.72 in CodeBLEU, and 7.7\\% in the exact match. Alongside this, our task and dataset introduce new challenges to the community, including when and what CQs should be asked.","urldate":"2023-01-06","author":[{"propositions":[],"lastnames":["Li"],"firstnames":["Haau-Sing"],"suffixes":[]},{"propositions":[],"lastnames":["Mesgar"],"firstnames":["Mohsen"],"suffixes":[]},{"propositions":[],"lastnames":["Martins"],"firstnames":["André","F.","T."],"suffixes":[]},{"propositions":[],"lastnames":["Gurevych"],"firstnames":["Iryna"],"suffixes":[]}],"year":"2022","note":"Publisher: arXiv Version Number: 1","keywords":"Computation and Language (cs.CL), FOS: Computer and information sciences","bibtex":"@article{li_asking_2022,\n\ttitle = {Asking {Clarification} {Questions} for {Code} {Generation} in {General}-{Purpose} {Programming} {Language}},\n\tcopyright = {Creative Commons Attribution 4.0 International},\n\turl = {https://arxiv.org/abs/2212.09885},\n\tdoi = {10.48550/ARXIV.2212.09885},\n\tabstract = {Code generation from text requires understanding the user's intent from a natural language description (NLD) and generating an executable program code snippet that satisfies this intent. While recent pretrained language models (PLMs) demonstrate remarkable performance for this task, these models fail when the given NLD is ambiguous due to the lack of enough specifications for generating a high-quality code snippet. In this work, we introduce a novel and more realistic setup for this task. We hypothesize that ambiguities in the specifications of an NLD are resolved by asking clarification questions (CQs). Therefore, we collect and introduce a new dataset named CodeClarQA containing NLD-Code pairs with created CQAs. We evaluate the performance of PLMs for code generation on our dataset. The empirical results support our hypothesis that clarifications result in more precise generated code, as shown by an improvement of 17.52 in BLEU, 12.72 in CodeBLEU, and 7.7{\\textbackslash}\\% in the exact match. Alongside this, our task and dataset introduce new challenges to the community, including when and what CQs should be asked.},\n\turldate = {2023-01-06},\n\tauthor = {Li, Haau-Sing and Mesgar, Mohsen and Martins, André F. T. and Gurevych, Iryna},\n\tyear = {2022},\n\tnote = {Publisher: arXiv\nVersion Number: 1},\n\tkeywords = {Computation and Language (cs.CL), FOS: Computer and information sciences},\n}\n\n\n\n\n\n\n\n","author_short":["Li, H.","Mesgar, M.","Martins, A. F. T.","Gurevych, I."],"key":"li_asking_2022","id":"li_asking_2022","bibbaseid":"li-mesgar-martins-gurevych-askingclarificationquestionsforcodegenerationingeneralpurposeprogramminglanguage-2022","role":"author","urls":{"Paper":"https://arxiv.org/abs/2212.09885"},"keyword":["Computation and Language (cs.CL)","FOS: Computer and information sciences"],"metadata":{"authorlinks":{}}},"bibtype":"article","biburl":"https://bibbase.org/zotero/abhishek-p","dataSources":["h7kKWXpJh2iaX92T5"],"keywords":["computation and language (cs.cl)","fos: computer and information sciences"],"search_terms":["asking","clarification","questions","code","generation","general","purpose","programming","language","li","mesgar","martins","gurevych"],"title":"Asking Clarification Questions for Code Generation in General-Purpose Programming Language","year":2022}