Research map / Large language models / Reasoning and chain of thought
From Guessing to Placeholding: A Cost-Theoretic Framework for Uncertainty-Aware Code Completion
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes Adaptive Placeholder Completion (APC), where code LLMs output explicit placeholders at high-entropy positions, trained with SFT and a cost-based GRPO reward, with a cost-theoretic entropy threshold argument.
Problem
Code completion LLMs always force a concrete prediction (Hard Completion), even when context is insufficient, causing costly hallucinations and editing overhead for developers.
Approach
Formulate code completion as expected user-cost minimization, prove a critical entropy threshold above which emitting placeholders yields lower expected cost than hard completion, and train models to emit placeholders via SFT on edit-log-derived data followed by GRPO with a cost-based reward.
Key results
- GRPO raises Qwen2.5-Coder-7B PC-test F1 to 38.18 and lowers Cost from 60.75 (base) to 36.38 while keeping HCR at 100%.
- A/B test on 1.8M real interactions: APC cuts cursor moves by 37.4% and read-and-edit time by 31.2% versus HC-only.
- Pass@1 on HumanEval Infilling for Qwen2.5-Coder-7B rises from 0.5798 (base) to 0.8315 (GRPO) single-line.
Surprising findings
- Fixed entropy or confidence threshold post-processing of base models yields no net cost benefit, with cost converging to base level regardless of threshold.
- Pass@1 on HumanEval Infilling improves markedly after APC training, even for hard completions.
Limitations
- Theoretical threshold relies on uniform worst-case entropy assumption and static cost ratio; authors acknowledge it is not directly usable in deployment.
- Character-level edit similarity is a proxy for user editing cost and may not capture semantic error severity.
- PC benchmark is curated by in-house annotators and may reflect their biases; data is proprietary.
Experimental setup
Datasets: HumanEval Infilling real-world user edit logs (filtered)
Benchmarks: HumanEval Infilling PC Test (523 curated samples) online A/B test
Metrics: HCR PCR EM Edit Similarity Precision F1 Expected Cost Pass@1 cursor moves time for read and edit
Baselines: Base instruct models SFT-User GRPO-ES fixed entropy/confidence threshold post-processing
Builds on: GRPO Fill-in-the-Middle HumanEval Infilling
Closest papers by meaning
- Training Language Models to Generate Quality Code with Program Analysis Feedback (NeurIPS 2025 · similarity 0.86)
- StepCodeReasoner: Aligning Code Reasoning with Stepwise Execution Traces via Reinforcement Learning (ICML 2026 · similarity 0.86)
- RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning (ICML 2025 · similarity 0.86)
- Simple Baselines are Competitive with Code Evolution (NeurIPS 2026 · similarity 0.86)
- CodeScaler: Scaling Code LLM Training and Test-Time Inference via Reward Models (NeurIPS 2026 · similarity 0.86)
- Planning in Natural Language Improves LLM Search for Code Generation (ICLR 2025 · similarity 0.85)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
