mlsanityData to 7 Oct 2026

Can Code Language Models Learn Clarification-Seeking Behaviors?

arXiv 2504.16331 ↗First posted 23 Apr 2025cs.SE cs.LGcited by 5

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2021Program Synthesis with Large Language Modelscited by 3,509
  5. 2023Qwen Technical Reportcited by 3,273
  6. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  7. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  9. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  10. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  11. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  12. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
5 more
  1. 2022Towards Understanding Chain-of-Thought Prompting: An Empirical Study of What Matterscited by 221
  2. 2022Interactive Code Generation via Test-Driven User-Intent Formalizationcited by 50
  3. 2024HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agentcited by 24
  4. 2024Rethinking Software Engineering in the Foundation Model Era: From Task-Driven AI Copilots to Goal-Driven AI Pair Programmerscited by 11
  5. 2023Alexpaca: Learning Factual Clarification Question Generation Without Examplescited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 2; 2026: 3.

5 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agents
  2. 2026Ask or Assume? Uncertainty-Aware Clarification-Seeking in Coding Agents
  3. 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving
  4. 2025LMR-BENCH: Evaluating LLM Agent's Ability on Reproducing Language Modeling Research
  5. 2026Uncertainty Decomposition for Clarification Seeking in LLM Agents
  6. 2025Artificial or Just Artful? Do LLMs Bend the Rules in Programming? ↗
  7. 2026Uncertainty-Aware Clarification in LLM Agents with Information Gain
  8. 2026CONTRA: Discovering and Qualifying Behavior-Changing Questions for Selective Clarification in LLM Code Generation