TreeRanker: Fast and Model-agnostic Ranking System for Code Suggestions in IDEs

📅 2025-08-04
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing IDE code completion ranking methods rely heavily on heuristic rules or lightweight models, limiting their ability to adequately model contextual information and generalize across diverse projects. Method: We propose a lightweight, model-agnostic ranking approach: candidate identifiers—generated via static analysis—are organized into a trie; a pre-trained language model then performs fine-grained token-level probability scoring over all trie paths in a single forward pass, followed by greedy decoding and score aggregation for efficient ranking. Crucially, our method requires no beam search, prompt engineering, or model fine-tuning, and is compatible with arbitrary language model architectures. Contribution/Results: Experiments demonstrate significant improvements in recommendation accuracy (Top-1/Top-5) and inference latency. The method integrates seamlessly into mainstream IDEs, establishing a new paradigm for code completion ranking that achieves high precision, low latency, and strong cross-project generalization.

Technology Category

Application Category

📝 Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

Improving ranking of code suggestions in IDEs
Enhancing context-aware completion without model changes
Fast model-agnostic scoring for token-level completions
Innovation

Methods, ideas, or system contributions that make the work stand out.

Lightweight model-agnostic scoring for completions
Prefix tree organization for efficient decoding
Token-aware ranking without beam search
🔎 Similar Papers
No similar papers found.