Token-level code completion is one of the most critical features in modern Integrated Development Environments (IDEs). It assists developers by suggesting relevant identifiers and APIs during coding. While completions are typically derived from static analysis, their usefulness depends heavily on how they are ranked, as correct predictions buried deep in the list are rarely seen by users. Most current systems rely on hand-crafted heuristics or lightweight machine learning models trained on user logs, which can be further improved to capture context information and generalize across projects and coding styles. In this work, we propose a new scoring approach to ranking static completions using language models in a lightweight and model-agnostic way. Our method organizes all valid completions into a prefix tree and performs a single greedy decoding pass to collect token-level scores across the tree. This enables a precise token-aware ranking without needing beam search, prompt engineering, or model adaptations. The approach is fast, architecture-agnostic, and compatible with already deployed models for code completion. These findings highlight a practical and effective pathway for integrating language models into already existing tools within IDEs, and ultimately providing smarter and more responsive developer assistance.
代码完成是一种流行的软件开发工具,集成到所有主要的IDE中。许多神经语言模型在合成基准上的完成建议预测中取得了令人满意的结果。然而,最近的一项研究When Code Completion Fails:a Case Study on Real-World Completions表明,这些结果可能不会转化为现实世界性能的改善。为了对抗这种影响,我们在真实世界的代码完成示例上训练模型,发现这些模型的准确率分别比在提交的源代码和工作版本快照上训练的模型高出12.8%和13.8%。我们在建模技术中观察到这种改进,并通过A/B测试表明,它对应于程序员实际自动完成使用量增加6.2%。此外,我们的研究还描述了一个大型的自动补全使用记录语料库,以研究为什么在真实世界的例子上训练会导致更强大的模型。
SLEAN: Simple Lightweight Ensemble Analysis Network for Multi-Provider LLM Coordination: Design, Implementation, and Vibe Coding Bug Investigation Case Study