mlsanityData to 7 Oct 2026

Python Code Generation by Asking Clarification Questions

arXiv 2212.09885 ↗First posted 19 Dec 2022cs.CLcited by 16

Not on the map. Why?

Abstract (arXiv)

Code generation from text requires understanding the user's intent from a natural language description and generating an executable code snippet that satisfies this intent. While recent pretrained language models demonstrate remarkable performance for this task, these models fail when the given natural language description is under-specified. In this work, we introduce a novel and more realistic setup for this task. We hypothesize that the under-specification of a natural language description can be resolved by asking clarification questions. Therefore, we collect and introduce a new dataset named CodeClarQA containing pairs of natural language descriptions and code with created synthetic clarification questions and answers. The empirical results of our evaluation of pretrained language model performance on code generation show that clarifications result in more precisely generated code, as shown by the substantial improvement of model performance in all evaluation metrics. Alongside this, our task and dataset introduce new challenges to the community, including when and what clarification questions should be asked. Our code and dataset are available on GitHub.

Key facts. Cited by 16 papers in the map (data through 7 Oct 2026). Builds on 31 of its 56 references that are in the map. First posted on arXiv 19 Dec 2022.

Builds on

31 of 56 references.

References · 31

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  4. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  7. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  8. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  9. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  10. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  11. 2020Stanza: A Python Natural Language Processing Toolkit for Many Human Languagescited by 719
  12. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
19 more
  1. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  2. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  3. 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
  4. 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
  5. 2021Retrieval Augmented Code Generation and Summarizationcited by 148
  6. 2019Asking Clarifying Questions in Open-Domain Information-Seeking Conversationscited by 136
  7. 2018Learning to Ask Good Questions: Ranking Clarification Questions using Neural Expected Value of Perfect Informationcited by 110
  8. 2018Mapping Language to Code in Programmatic Contextcited by 104
  9. 2021Building and Evaluating Open-Domain Dialogue Corpora with Clarifying Questionscited by 63
  10. 2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationcited by 56
  11. 2022Interactive Code Generation via Test-Driven User-Intent Formalizationcited by 50
  12. 2019JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code Generationcited by 49
  13. 2021Ask what's missing and what's useful: Improving Clarification Question Generation using Global Knowledgecited by 40
  14. 2020Incorporating External Knowledge through Pre-training for Natural Language to Code Generationcited by 36
  15. 2022Execution-based Evaluation for Data Science Code Generation Modelscited by 31
  16. 2020A Toolkit for Generating Code Knowledge Graphscited by 17
  17. 2021HAConvGNN: Hierarchical Attention Based Convolutional Graph Neural Network for Code Documentation Generation in Jupyter Notebookscited by 6
  18. 2021Can Machines Read Coding Manuals Yet? -- A Benchmark for Building Better Language Models for Code Understandingcited by 5
  19. 2022Generating Clarifying Questions for Query Refinement in Source Code Searchcited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 6; 2025: 4; 2026: 6.

16 papers.

Sort:

By area:

  1. 2024AMBROSIA: A Benchmark for Parsing Ambiguous Questions into Database Queriescited by 32
  2. 2024A Survey of Conversational Searchcited by 22
  3. 2026Ask or Assume? Uncertainty-Aware Clarification-Seeking in Coding Agentscited by 15
  4. 2025Disambiguate First, Parse Later: Generating Interpretations for Ambiguity Resolution in Semantic Parsingcited by 12
  5. 2024On the Limitations of Embedding Based Methods for Measuring Functional Correctness for Code Generationcited by 6
  6. 2026Dialogue SWE-Bench: A Benchmark for Dialogue-Driven Coding Agentscited by 6
  7. 2026ICAE-Bench: Evaluating Coding Agents as Interactive Project Builderscited by 5
  8. 2024Taking Action Towards Graceful Interaction: The Effects of Performing Actions on Modelling Policies for Instruction Clarification Requestscited by 4
  9. 2026Ambig-DS: A Benchmark for Task-Framing Ambiguity in Data-Science Agentscited by 2
  10. 2024It Couldn't Help But Overhear: On the Limits of Modelling Meta-Communicative Grounding Acts with Supervised Learningcited by 1
  11. 2024Selective Shot Learning for Code Explanationcited by 1
  12. 2025Understanding and supporting how developers prompt for LLM-powered code editing in practicecited by 1
4 more
  1. 2025CRABS: A syntactic-semantic pincer strategy for bounding LLM interpretation of Python notebookscited by 1
  2. 2025Identifying & Interactively Refining Ambiguous User Goals for Data Visualization Code Generationcited by 1
  3. 2026Talking to a Know-It-All GPT or a Second-Guesser Claude? How Repair reveals unreliable Multi-Turn Behavior in LLMscited by 1
  4. 2026SAILOR: Solver-Assisted Interactive LLM-based Optimization Recoverycited by 0