Can Code Language Models Learn Clarification-Seeking Behaviors?
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have demonstrated remarkable capabilities in code generation tasks. However, a gap remains between their output and the problem-solving strategies of human developers. Unlike humans, who spend substantial time disambiguating requirements through iterative dialogue, LLMs often generate code despite ambiguities in natural language requirements, leading to unreliable solutions. Different from prior work, we study whether a Code LLM can be fine-tuned to learn clarification-seeking behavior. While recent work has focused on LLM-based agents for iterative code generation, we argue that the ability to recognize and query ambiguous requirements should be intrinsic to the models themselves, especially in agentic AI where models and humans collaborate. We present ClarifyCoder, a framework with synthetic data generation and instruction-tuning that fine-tunes an LLM to identify ambiguities and request clarification before code generation. Our approach has two components: (1) a data synthesis technique that augments programming datasets with scenarios requiring clarification to generate clarification-aware training data, and (2) a fine-tuning strategy that teaches models to prioritize seeking clarification over immediate code generation when faced with incomplete or ambiguous requirements. We also provide an empirical analysis of integrating ClarifyCoder with standard fine-tuning for joint optimization of clarification-awareness and coding ability. Experimental results show that ClarifyCoder achieves a 63% communication rate (40% absolute increase) and a 52% good question rate (30% absolute increase) on ambiguous tasks, significantly improving LLMs' communication capabilities while maintaining code generation performance.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 17 of its 36 references that are in the map. First posted on arXiv 23 Apr 2025.
Builds on
17 of 36 references.
References · 17
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Qwen Technical Reportcited by 3,273
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2020IntelliCode Compose: Code Generation Using Transformercited by 225
5 more
- 2022Towards Understanding Chain-of-Thought Prompting: An Empirical Study of What Matterscited by 221
- 2022Interactive Code Generation via Test-Driven User-Intent Formalizationcited by 50
- 2024HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agentcited by 24
- 2024Rethinking Software Engineering in the Foundation Model Era: From Task-Driven AI Copilots to Goal-Driven AI Pair Programmerscited by 11
- 2023Alexpaca: Learning Factual Clarification Question Generation Without Examplescited by 2
Built on by
Citing papers per year: 2025: 2; 2026: 3.
5 papers.
- 2025LLM-based Agents Suffer from Hallucinations: A Survey of Taxonomy, Methods, and Directionscited by 49
- 2026InteractWeb-Bench: Can Multimodal Agent Escape Blind Execution in Interactive Website Generation?cited by 1
- 2026Obey, Diverge, Collapse: Blind Obedience to Incorrect Instructions Drives Code LLMs to Irrecoverable Code Semantic Collapsecited by 1
- 2025COCORELI: Enforcing Execution Preconditions for Reliable Collaborative Instruction Followingcited by 0
- 2026Neurosymbolic Auditing of Natural-Language Software Requirementscited by 0
- 2026Obey, Diverge, Collapse: Blind Obedience to Incorrect Instructions Drives Code LLMs to Irrecoverable Code Semantic Collapse5 Jul 2026
- 2026Neurosymbolic Auditing of Natural-Language Software Requirements13 May 2026
- 2026InteractWeb-Bench: Can Multimodal Agent Escape Blind Execution in Interactive Website Generation?30 Apr 2026
- 2025LLM-based Agents Suffer from Hallucinations: A Survey of Taxonomy, Methods, and Directions23 Sep 2025
- 2025COCORELI: Enforcing Execution Preconditions for Reliable Collaborative Instruction Following29 Aug 2025
Similar, not cited
Close in wording, no citation either way
- 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agents
- 2026Ask or Assume? Uncertainty-Aware Clarification-Seeking in Coding Agents
- 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving
- 2025LMR-BENCH: Evaluating LLM Agent's Ability on Reproducing Language Modeling Research
- 2026Uncertainty Decomposition for Clarification Seeking in LLM Agents
- 2025Artificial or Just Artful? Do LLMs Bend the Rules in Programming? ↗
- 2026Uncertainty-Aware Clarification in LLM Agents with Information Gain
- 2026CONTRA: Discovering and Qualifying Behavior-Changing Questions for Selective Clarification in LLM Code Generation