Lune

ICSE2026Top-tier venue

TypeCare: Boosting Python Type Inference Models via Context-Aware Re-Ranking and Augmentation

Wonseok Oh, Hakjoo Oh

2026Year

Abstract

Type annotations improve Python code quality by enabling better readability, static analysis, and developer productivity. However, manually annotating existing code is labor-intensive and errorprone. While recent learning-based models have advanced automatic type inference, they struggle with rare or complex types that are underrepresented in training data.

We present TypeCare, a model-agnostic post-processing technique that refines the outputs of existing type inference models using code context, without requiring retraining or fine-tuning existing models. TypeCare combines two key components: (1) Re-Ranking, which prioritizes semantically and syntactically relevant types, and (2) Augmentation, which generates additional contextually plausible candidates. Applied to three state-of-the-art type inference models-TypeT5, Tiger, and TypeGen-TypeCare consistently improves top-1 accuracy, achieving up to 40.1% gains on complex types that existing models often fail to predict correctly.

• Software and its engineering → Software testing and debugging.

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext 529ad1b2-bfaf-426f-9af4-e0f117282c33

Builds on12

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines