EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

TypePro: Boosting LLM-Based Type Inference via Inter-Procedural Slicing

Teyu Lin, Minghao Fan, Huaxun Huang, Zhirong Shen, Rongxin Wu

Proceedings of the ACM on Software Engineering · 30.06.2026 · 3 (FSE) · 2630-2651

DOI: 10.1145/3808124 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Proceedings of the ACM on Software Engineering, online erschienen am 30.06.2026. Verfasst von Teyu Lin und 4 weiteren Autor:innen. Die Arbeit nennt 36 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: National Natural Science Foundation of China, Youth Program of the Xiamen Natural Science Foundation, Fundamental Research Funds for the Central Universities.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Dynamic languages (such as Python and JavaScript) offer flexibility and simplified type handling for programming, but this can also lead to an increase in type-related errors and additional overhead for compile-time type inference. As a result, type inference for dynamic languages has become a popular research area. Existing approaches typically achieve type inference through static analysis, machine learning, or large language models (LLMs). However, current work only focuses on the direct dependencies of variables related to type inference as the context, resulting in incomplete contextual information and thus affecting the accuracy of type inference. To address this issue, this paper proposes a method called TypePro, which leverages LLMs for type inference in dynamic languages. TypePro supplements contextual information by conducting inter-procedural code slicing. Then, TypePro proposes a set of candidate complex types based on the structural information of data types implied in the slices, thereby addressing the lack of domain knowledge of LLMs. We conducted experiments on the ManyTypes4Py and ManyTypes4TypeScript datasets, achieving Top-1 exact match (EM) rates of 88.9% and 86.6%, respectively. Notably, TypePro improves the Top-1 Exact Match by 7.1 and 10.3 percentage points over the second-best approach, showing the effectiveness and robustness of TypePro.

Förderung

  • National Natural Science Foundation of China
  • Youth Program of the Xiamen Natural Science Foundation
  • Fundamental Research Funds for the Central Universities

Zitieren

APA

Lin, T., Fan, M., Huang, H., Shen, Z., & Wu, R. (2026). TypePro: Boosting LLM-Based Type Inference via Inter-Procedural Slicing. Proceedings of the ACM on Software Engineering, 3(FSE), 2630-2651. https://doi.org/10.1145/3808124

Vancouver

Lin T, Fan M, Huang H, Shen Z, Wu R. TypePro: Boosting LLM-Based Type Inference via Inter-Procedural Slicing. Proceedings of the ACM on Software Engineering. 2026;3(FSE):2630-2651. doi:10.1145/3808124

BibTeX
@article{Lin2026,
  author = {Lin, Teyu and Fan, Minghao and Huang, Huaxun and Shen, Zhirong and Wu, Rongxin},
  title = {TypePro: Boosting LLM-Based Type Inference via Inter-Procedural Slicing},
  journal = {Proceedings of the ACM on Software Engineering},
  year = {2026},
  volume = {3},
  number = {FSE},
  pages = {2630--2651},
  doi = {10.1145/3808124}
}
Kostenlos starten →