TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories
Type inference for dynamic languages like Python is a persistent challenge in software engineering. While large language models (LLMs) have shown promise in code understanding, their type inference capabilities remain underexplored. We introduce TypyBench, a benchmark designed to evaluate LLMs' type inference across entire Python repositories. TypyBench features two novel metrics: TypeSim, which captures nuanced semantic relationships between predicted and ground truth types, and TypeCheck, which assesses type consistency across codebases. Our evaluation of various LLMs on a curated dataset of 50 high-quality Python repositories reveals that, although LLMs achieve decent TypeSim scores, they struggle with complex nested types and exhibit significant type consistency errors. These findings suggest that future research should shift focus from improving type similarity to addressing repository-level consistency. TypyBench provides a foundation for this new direction, offering insights into model performance across different type complexities and usage contexts. Our code and data are available at https://github.com/typybench/typybench.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
TypeProbe: Recovering Type Representations from Hidden States of Pre-trained Code Models
State-of-the-art code models achieve impressive performance, yet the extent to which they internally encode type information remains poorly understood. We probe the residual streams of pretrained code models for internal…
Identifying Untyped Relation Mentions in a Corpus given an Ontology
Type Prediction With Program Decomposition and Fill-in-the-Type Training
TypeScript and Python are two programming languages that support optional type annotations, which are useful but tedious to introduce and maintain. This has motivated automated type prediction: given an untyped program, …
PredictionType predictionDiscriminating between Similar Languages Using a Combination of Typed and Untyped Character N-grams and Words
This paper presents the cic{\_}ualg{'}s system that took part in the Discriminating between Similar Languages (DSL) shared task, held at the VarDial 2017 Workshop. This year{'}s task aims at identifying 14 languages acro…
General ClassificationInformation RetrievalMachine TranslationManyTypes4TypeScript: A Comprehensive TypeScript Dataset for Sequence-Based Type Inference
In this paper, we present ManyTypes4TypeScript, a very large corpus for training and evaluating machine-learning models for sequence-based type inference in TypeScript. The dataset includes over 9 million type annotat…
Type prediction