Live
Black Hat USAAI BusinessBlack Hat AsiaAI Business40 Days of Building HarshAI: What I Learned About AI AutomationDEV CommunityMoving fast with agents without losing comprehensionDEV CommunityCharlie's Chocolate Factory Paperclip — Ep.1DEV CommunityAI-Generated APIs Keep Shipping Wildcard CORS. Here's the Fix.DEV CommunityHarshAI: I Built a Zapier Killer in 40 Days (Open Source)DEV CommunitySanta Augmentcode Intent Ep.5DEV CommunityBuilding a Production-Ready Composable AI Agent System with CopilotKit and LangGraphDEV CommunityI Built 3 APIs for Turkey’s Used-Car Market with ApifyDEV CommunitySemantic Search with TypeScript: Using embed() and embedMany() for Vector SearchDEV CommunityVoice AI Agents: Building Speech-to-Speech Apps with TypeScriptDEV CommunityRightNow AI Releases AutoKernel: An Open-Source Framework that Applies an Autonomous Agent Loop to GPU Kernel Optimization for Arbitrary PyTorch ModelsMarkTechPostA Tale of AI Betrayal and Snapshotting VictoryHacker News AI TopBlack Hat USAAI BusinessBlack Hat AsiaAI Business40 Days of Building HarshAI: What I Learned About AI AutomationDEV CommunityMoving fast with agents without losing comprehensionDEV CommunityCharlie's Chocolate Factory Paperclip — Ep.1DEV CommunityAI-Generated APIs Keep Shipping Wildcard CORS. Here's the Fix.DEV CommunityHarshAI: I Built a Zapier Killer in 40 Days (Open Source)DEV CommunitySanta Augmentcode Intent Ep.5DEV CommunityBuilding a Production-Ready Composable AI Agent System with CopilotKit and LangGraphDEV CommunityI Built 3 APIs for Turkey’s Used-Car Market with ApifyDEV CommunitySemantic Search with TypeScript: Using embed() and embedMany() for Vector SearchDEV CommunityVoice AI Agents: Building Speech-to-Speech Apps with TypeScriptDEV CommunityRightNow AI Releases AutoKernel: An Open-Source Framework that Applies an Autonomous Agent Loop to GPU Kernel Optimization for Arbitrary PyTorch ModelsMarkTechPostA Tale of AI Betrayal and Snapshotting VictoryHacker News AI Top
AI NEWS HUBbyEIGENVECTOREigenvector

From Guessing to Placeholding: A Cost-Theoretic Framework for Uncertainty-Aware Code Completion

arXiv cs.CLby Liang Zhu, Haolin Chen, Lidong Zhao, Xian WuApril 4, 20262 min read0 views
Source Quiz

arXiv:2604.01849v1 Announce Type: new 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-

View PDF HTML (experimental)

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.

Subjects:

Computation and Language (cs.CL)

Cite as: arXiv:2604.01849 [cs.CL]

(or arXiv:2604.01849v1 [cs.CL] for this version)

https://doi.org/10.48550/arXiv.2604.01849

arXiv-issued DOI via DataCite (pending registration)

Submission history

From: Liang Zhu [view email] [v1] Thu, 2 Apr 2026 10:03:32 UTC (126 KB)

Was this article helpful?

Sign in to highlight and annotate this article

AI
Ask AI about this article
Powered by Eigenvector · full article context loaded
Ready

Conversation starters

Ask anything about this article…

Daily AI Digest

Get the top 5 AI stories delivered to your inbox every morning.

More about

modellanguage modeltraining

Knowledge Map

Knowledge Map
TopicsEntitiesSource
From Guessi…modellanguage mo…trainingannouncevaluationmillionarXiv cs.CL

Connected Articles — Knowledge Graph

This article is connected to other articles through shared AI topics and tags.

Knowledge Graph100 articles · 299 connections
Scroll to zoom · drag to pan · click to open

Discussion

Sign in to join the discussion

No comments yet — be the first to share your thoughts!

More in Models