MSc Thesis Proposal: From Inference to Evolution: Integrating Static Analysis and LLMs for Python Type Annotations

Wednesday, December 2, 2026 - 13:00

The School of Computer Science is pleased to present…

From Inference to Evolution: Integrating Static Analysis and LLMs for Python Type Annotations

MSc Thesis Proposal by: Ali Aman

 

Date: Wednesday, December 2, 2026

Time:  1:00 PM

Location: Essex Hall 122

 

Abstract:

Python is a popular programming language, in part because of its simplicity. Developers are not required to explicitly declare variable types, which reduces the amount of code they need to write. However, research shows that missing type information makes code harder to read, maintain, and analyze using automated tools. To address this issue, Python introduced optional syntax for specifying the expected types of variables, function parameters, and return values, known as type annotations. Nevertheless, manually adding type annotations is a tedious and time-consuming task. To alleviate this burden, we have developed a lightweight, usage-driven static analysis technique that infers types across entire Python projects. Our technique outperforms existing static analysis-based tools and is approximately an order of magnitude faster than deep learning-based systems. However, Python's dynamic language features pose significant challenges to static type inference. Recent studies have also explored the use of large language models (LLMs) for type inference in Python code, but their effectiveness in handling different dynamic language features remains insufficiently understood. To better understand their capabilities and limitations, we plan to investigate how LLMs perform across different categories of dynamic language features and how the amount of source code context and the choice of LLM affect their type inference accuracy. While inferring missing type annotations can improve code maintainability, maintaining the correctness of existing type annotations as code evolves presents an additional challenge. To address this challenge, we plan to leverage the complementary strengths of static analysis and LLMs to detect and repair outdated type annotations. Specifically, this thesis aims to develop a hybrid approach that uses static analysis when sufficient evidence is available and leverages LLMs when static analysis alone is insufficient.

 

Thesis Committee:

Reader 1: Dr. Saeed Samet

Reader 2: Dr. Jessica Chen

Advisor: Dr. Muhammad Asaduzzaman