TreeRanker: Fast and Model-agnostic Ranking System for Code Suggestions
  in IDEs
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.
689210ad1e348c42dfd27f8d
Daniele Cipollone
claimed_verified
2025-08-06T19:19:47.710Z
6554e2dcfcb10ad33d88dcea
https://cdn-avatars.huggingface.co/v1/production/uploads/6554e2dcfcb10ad33d88dcea/V4WnB358ciZ0Ry3APDF57.png
Daniele Cipollone
user
DanCip
689210ad1e348c42dfd27f8e
Egor Bogomolov
689210ad1e348c42dfd27f8f
Arie van Deursen
689210ad1e348c42dfd27f90
Maliheh Izadi
TreeRanker: Fast and Model-agnostic Ranking System for Code Suggestions
  in IDEs
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.
A new scoring approach using language models ranks static code completions in IDEs by organizing them into a prefix tree and performing a single greedy decoding pass.
token-level code completion Integrated Development Environments (IDEs) static analysis language models prefix tree greedy decoding beam search prompt engineering model adaptations