From Guessing to Placeholding: A Cost-Theoretic Framework for Uncertainty-Aware Code Completion
- URL: http://arxiv.org/abs/2604.01849v1
- Date: Thu, 02 Apr 2026 10:03:32 GMT
- Title: From Guessing to Placeholding: A Cost-Theoretic Framework for Uncertainty-Aware Code Completion
- Abstract summary: We propose a collaborative framework that extends Hard Completion (HC) by strategically outputting explicit placeholders at high-entropy positions.<n>We instantiate this framework by constructing training data from filtered real-world edit logs and design a cost-based reward function for reinforcement learning.<n>Our work provides both a theoretical foundation and a practical training framework for uncertainty-aware code completion, demonstrating that adaptive abstention can be learned end-to-end.
- Score: 11.596110180018838
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: While Large Language Models (LLMs) have demonstrated exceptional proficiency in code completion, they typically adhere to a Hard Completion (HC) paradigm, compelling the generation of fully concrete code even amidst insufficient context. Our analysis of 3 million real-world interactions exposes the limitations of this strategy: 61% of the generated suggestions were either edited after acceptance or rejected despite exhibiting over 80% similarity to the user's subsequent code, suggesting that models frequently make erroneous predictions at specific token positions. Motivated by this observation, we propose Adaptive Placeholder Completion (APC), a collaborative framework that extends HC by strategically outputting explicit placeholders at high-entropy positions, allowing users to fill directly via IDE navigation. Theoretically, we formulate code completion as a cost-minimization problem under uncertainty. Premised on the observation that filling placeholders incurs lower cost than correcting errors, we prove the existence of a critical entropy threshold above which APC achieves strictly lower expected cost than HC. We instantiate this framework by constructing training data from filtered real-world edit logs and design a cost-based reward function for reinforcement learning. Extensive evaluations across 1.5B--14B parameter models demonstrate that APC reduces expected editing costs from 19% to 50% while preserving standard HC performance. Our work provides both a theoretical foundation and a practical training framework for uncertainty-aware code completion, demonstrating that adaptive abstention can be learned end-to-end without sacrificing conventional completion quality.
Related papers
- SuCo: Sufficiency-guided Continuous Adaptive Reasoning [59.17222918775686]
Large Reasoning Models (LRMs) often generate excessively long Chain-of-Thoughts (CoT)<n>Existing efforts to mitigate this inefficiency typically rely on discrete reasoning modes or fixed budget tiers.<n>We introduce Minimal Sufficient CoT (MSC), defined as the shortest prefix of a CoT trajectory which is adequate for producing the correct answer.
arXiv Detail & Related papers (2026-06-16T08:52:15Z) - Escaping the Diversity Trap in Robotic Manipulation via Anchor-Centric Adaptation [50.23374353859762]
"Maximizing coverage" by collecting diverse, single-shot demonstrations can be self-defeating due to non-vanishing estimation noise.<n>We formalize this phenomenon as a Coverage--Density Trade-off.<n>We propose Anchor-Centric Adaptation (ACA), a two-stage framework that first stabilizes a policy skeleton through repeated demonstrations at core anchors, then expands coverage to high-risk boundaries via teacher-forced error mining and constrained residual updates.
arXiv Detail & Related papers (2026-05-08T07:35:24Z) - Chain of Uncertain Rewards with Large Language Models for Reinforcement Learning [52.48243762705385]
Chain of Uncertain Rewards (CoUR) is a novel framework that integrates large language models (LLMs) to streamline reward function design and evaluation.<n>We show that CoUR achieves better performance and significantly lowers the cost of reward evaluations.
arXiv Detail & Related papers (2026-04-15T05:44:14Z) - Correct Answers from Sound Reasoning: Verifiable Process Supervision for Language Models [94.68358825189738]
We propose a post-training framework for verifiable domains that jointly optimize prediction accuracy and reasoning quality.<n>We evaluate VPS on chess, a controlled testbed where reasoning steps can be deterministically verified against engine signals.<n>VPS preserves accuracy while significantly improving reasoning quality, reducing win-rate error by up to 30% and restoring consistency to near saturation.
arXiv Detail & Related papers (2026-04-03T15:19:46Z) - Bridging the Arithmetic Gap: The Cognitive Complexity Benchmark and Financial-PoT for Robust Financial Reasoning [11.522192050185568]
Large Language Models suffer from "Arithmetic Hallucinations" and a systemic failure mode we term "Cognitive Collapse"<n>We introduce the Cognitive Complexity Benchmark (CCB), a robust evaluation framework grounded in a dataset constructed from 95 real-world Chinese A-share annual reports.<n>We propose the Iterative Dual-Phase Financial-PoT framework to address these failures.
arXiv Detail & Related papers (2026-01-29T01:33:33Z) - CIFE: Code Instruction-Following Evaluation [3.941243815951084]
We introduce a benchmark of 1,000 Python tasks, each paired with an average of 7 developer-specified constraints spanning 13 categories.<n>We evaluate 14 open- and closed-source models using complementary adherence metrics and propose the C2A Score, a composite measure that jointly captures correctness and constraint compliance.<n>Results reveal a substantial gap between partial and strict satisfaction, while strong models achieve over 90% partial adherence, strict adherence remains between 39-66%.
arXiv Detail & Related papers (2025-12-19T09:43:20Z) - Long-horizon Reasoning Agent for Olympiad-Level Mathematical Problem Solving [65.02106674311908]
This paper introduces Intern-S1-MO, a long-horizon math agent that conducts multi-round hierarchical reasoning.<n>By maintaining a compact memory in the form of lemmas, Intern-S1-MO can more freely explore the lemma-rich reasoning spaces.<n> Experiments show that Intern-S1-MO can obtain 26 out of 35 points on the non-geometry problems of IMO2025, matching the performance of silver medalists.
arXiv Detail & Related papers (2025-12-11T15:26:28Z) - Certainty-Guided Reasoning in Large Language Models: A Dynamic Thinking Budget Approach [0.15749416770494704]
We show that Certainty-Guided Reasoning (CGR) improves baseline accuracy while reducing token usage.<n>CGR can eliminate millions of tokens in aggregate, with tunable trade-offs between certainty thresholds and efficiency.<n>By integrating confidence into the reasoning process, CGR makes large reasoning language models more adaptive, trustworthy, and resource efficient.
arXiv Detail & Related papers (2025-09-09T14:57:15Z) - Additive Distributionally Robust Ranking and Selection [0.8283940114367679]
We propose a simple additive allocation (AA) procedure that aims to exclusively sample the $k + m - 1$ previously hypothesized critical scenarios.<n>We prove that AA is consistent and, surprisingly, achieves additivity in the strongest sense.<n>Results offer new and counterintuitive insights into the additive structure of DRR&S.
arXiv Detail & Related papers (2025-09-07T17:36:29Z) - Supervised Optimism Correction: Be Confident When LLMs Are Sure [91.7459076316849]
We establish a novel theoretical connection between supervised fine-tuning and offline reinforcement learning.<n>We show that the widely used beam search method suffers from unacceptable over-optimism.<n>We propose Supervised Optimism Correction, which introduces a simple yet effective auxiliary loss for token-level $Q$-value estimations.
arXiv Detail & Related papers (2025-04-10T07:50:03Z) - When Demonstrations Meet Generative World Models: A Maximum Likelihood
Framework for Offline Inverse Reinforcement Learning [62.00672284480755]
This paper aims to recover the structure of rewards and environment dynamics that underlie observed actions in a fixed, finite set of demonstrations from an expert agent.
Accurate models of expertise in executing a task has applications in safety-sensitive applications such as clinical decision making and autonomous driving.
arXiv Detail & Related papers (2023-02-15T04:14:20Z) - Robust Constrained Reinforcement Learning [21.316736188238806]
Constrained reinforcement learning is to maximize the expected reward subject to constraints on utilities/costs.
We propose a framework of robust constrained reinforcement learning under model uncertainty.
The goal is to guarantee that constraints on utilities/costs are satisfied for all MDPs in the uncertainty set, and to maximize the worst-case reward performance over the uncertainty set.
arXiv Detail & Related papers (2022-09-14T18:29:02Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.