mlsanityData to 14 Oct 2026

ClarifyGPT: Empowering LLM-based Code Generation with Intention Clarification

arXiv 2310.10996 ↗First posted 17 Oct 2023cs.SEcited by 38

On the map: World models → World models for language agents

Abstract (arXiv)

We introduce a novel framework named ClarifyGPT, which aims to enhance code generation by empowering LLMs with the ability to identify ambiguous requirements and ask targeted clarifying questions. In particular, ClarifyGPT first detects whether a given requirement is ambiguous by performing a code consistency check. If it is ambiguous, ClarifyGPT prompts an LLM to generate targeted clarifying questions. After receiving question responses, ClarifyGPT refines the ambiguous requirement and inputs it into the same LLM to generate a final code solution. To evaluate our ClarifyGPT, we first conduct a human evaluation involving ten participants who use ClarifyGPT for code generation on two publicly available benchmarks: MBPP-sanitized and MBPP-ET. The results show that ClarifyGPT elevates the performance (Pass@1) of GPT-4 from 70.96% to 80.80% on MBPP-sanitized. Furthermore, to perform large-scale automated evaluations of ClarifyGPT across different LLMs and benchmarks without requiring user participation, we introduce a high-fidelity simulation method to simulate user responses. The automated evaluation results also demonstrate that ClarifyGPT can significantly enhance code generation performance compared to the baselines. In particular, ClarifyGPT improves the average performance of GPT-4 and ChatGPT across four benchmarks from 68.02% to 75.75% and from 58.55% to 67.22%, respectively. We believe that ClarifyGPT can effectively facilitate the practical application of LLMs in real-world development environments.

Key facts. Cited by 38 papers in the map (data through 14 Oct 2026). Placed in World models for language agents, one of 11 directions in World models. Builds on 4 of its 45 references that are in the map. First posted on arXiv 17 Oct 2023.

Builds on

4 of 45 references.

References · 4

  1. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  2. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
  3. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  4. 2022Competition-Level Code Generation with AlphaCodecited by 1,462

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 1; 2024: 14; 2025: 15; 2026: 8.

38 papers.

Sort:

By area:

  1. 2024A Survey on Large Language Models for Code Generationcited by 658
  2. 2024Understanding World or Predicting Future? A Comprehensive Survey of World Modelscited by 166
  3. 2025CollabLLM: From Passive Responders to Active Collaboratorscited by 124
  4. 2024LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigationcited by 93
  5. 2025Paper2Code: Automating Code Generation from Scientific Papers in Machine Learningcited by 70
  6. 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
  7. 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
  8. 2025Training Proactive and Personalized LLM Agentscited by 46
  9. 2024Knowledge Boundary of Large Language Models: A Surveycited by 40
  10. 2024AMBROSIA: A Benchmark for Parsing Ambiguous Questions into Database Queriescited by 35
  11. 2025Large Language Models for Code Generation: A Comprehensive Survey of Challenges, Techniques, Evaluation, and Applicationscited by 26
  12. 2024A Survey of Conversational Searchcited by 22
26 more
  1. 2025QualityFlow: An Agentic Workflow for Program Synthesis Controlled by LLM Quality Checkscited by 22
  2. 2024A Pair Programming Framework for Code Generation via Multi-Plan Exploration and Feedback-Driven Refinementcited by 21
  3. 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
  4. 2025Disambiguate First, Parse Later: Generating Interpretations for Ambiguity Resolution in Semantic Parsingcited by 13
  5. 2025TOM-SWE: User Mental Modeling For Software Engineering Agentscited by 13
  6. 2024A Deep Dive Into Large Language Model Code Generation Mistakes: What and Why?cited by 10
  7. 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunitiescited by 8
  8. 2024Imagining a Future of Designing with AI: Dynamic Grounding, Constructive Negotiation, and Sustainable Motivationcited by 7
  9. 2024Planning-Driven Programming: A Large Language Model Programming Workflowcited by 7
  10. 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
  11. 2025Generative Interfaces for Language Modelscited by 6
  12. 2026DiscoverLLM: From Executing Intents to Discovering Themcited by 6
  13. 2024Automated Prompt Engineering for Cost-Effective Code Generation Using Evolutionary Algorithmcited by 5
  14. 2025Towards Advancing Code Generation with Large Language Models: A Research Roadmapcited by 5
  15. 2026Ambig-DS: A Benchmark for Task-Framing Ambiguity in Data-Science Agentscited by 5
  16. 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Actioncited by 4
  17. 2025Exploring the Challenges and Opportunities of AI-assisted Codebase Generationcited by 4
  18. 2025Reasoning about Intent for Ambiguous Requestscited by 4
  19. 2024Self-Explained Keywords Empower Large Language Models for Code Generationcited by 2
  20. 2025Evaluating Software Process Models for Multi-Agent Class-Level Code Generationcited by 2
  21. 2026Found in Conversation: LLMs Teach Themselves to Close the Multi-Turn Gapcited by 2
  22. 2025Knowledge-Guided Multi-Agent Framework for Application-Level Software Code Generationcited by 0
  23. 2026BALAR : A Bayesian Agentic Loop for Active Reasoningcited by 0
  24. 2026Turning Intent into Specifications: A Benchmark and an Interactive User-Assistant Agentcited by 0
  25. 2026DevIntent: How Much Does LLM-Generated Code Violate Developer Intent?cited by 0
  26. 2026CLEAT: Learning Value-Guided Clarification for Interactive Agentscited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2026CONTRA: Discovering and Qualifying Behavior-Changing Questions for Selective Clarification in LLM Code Generation
  2. 2024HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agent
  3. 2025LeetCodeDataset: A Temporal Dataset for Robust Evaluation and Efficient Training of Code LLMs
  4. 2025Disproving Program Equivalence with LLMs
  5. 2025DISTINCT: A Description-Guided Branch-Consistency Analysis Framework for Non-Regressive Test Case Generation ↗
  6. 2025Rubric Is All You Need: Enhancing LLM-based Code Evaluation With Question-Specific Rubrics
  7. 2024From Critique to Clarity: A Pathway to Faithful and Personalized Code Explanations with Large Language Models
  8. 2025Enabling Global, Human-Centered Explanations for LLMs:From Tokens to Interpretable Code and Test Generation