Typilus: Neural Type Hints
Not on the map. Why?
Abstract (arXiv)
Type inference over partial contexts in dynamically typed languages is challenging. In this work, we present a graph neural network model that predicts types by probabilistically reasoning over a program's structure, names, and patterns. The network uses deep similarity learning to learn a TypeSpace -- a continuous relaxation of the discrete space of types -- and how to embed the type properties of a symbol (i.e. identifier) into it. Importantly, our model can employ one-shot learning to predict an open vocabulary of types, including rare and user-defined ones. We realise our approach in Typilus for Python that combines the TypeSpace with an optional type checker. We show that Typilus accurately predicts types. Typilus confidently predicts types for 70% of all annotatable symbols; when it predicts a type, that type optionally type checks 95% of the time. Typilus can also find incorrect type annotations; two important and popular open source libraries, fairseq and allennlp, accepted our pull requests that fixed the annotation errors Typilus discovered.
Key facts. Cited by 29 papers in the map (data through 7 Oct 2026). First posted on arXiv 6 Apr 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 6; 2022: 10; 2023: 6; 2024: 3; 2025: 4.
29 papers.
Sort:
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 53
- 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?cited by 40
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2021Type4Py: Practical Deep Similarity Learning-Based Type Inference for Pythoncited by 19
- 2021GraphSearchNet: Enhancing GNNs via Capturing Global Dependencies for Semantic Code Searchcited by 15
- 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
- 2024Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicatescited by 14
- 2023TypeT5: Seq2seq Type Inference using Static Analysiscited by 12
- 2022AutoPruner: Transformer-Based Call Graph Pruningcited by 11
- 2021ManyTypes4Py: A Benchmark Python Dataset for Machine Learning-based Type Inferencecited by 9
17 more
- 2023LExecutor: Learning-Guided Executioncited by 7
- 2022Learning Program Semantics with Code Representations: An Empirical Studycited by 6
- 2022Learning Program Representations with a Tree-Structured Transformercited by 6
- 2023Type Prediction With Program Decomposition and Fill-in-the-Type Trainingcited by 6
- 2023An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graphcited by 5
- 2021PSIMiner: A Tool for Mining Rich Abstract Syntax Trees from Codecited by 4
- 2021Cross-Lingual Transfer Learning for Statistical Type Inferencecited by 2
- 2022JEMMA: An Extensible Java Dataset for ML4Code Applicationscited by 2
- 2025Treefix: Enabling Execution with a Tree of Prefixescited by 2
- 2022Unveiling Project-Specific Bias in Neural Code Modelscited by 1
- 2022Evaluating the Impact of Source Code Parsers on ML4SE Modelscited by 1
- 2022Cross-Domain Evaluation of a Deep Learning-Based Type Inference Systemcited by 1
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Modelscited by 1
- 2025Call Me Maybe: Enhancing JavaScript Call Graph Construction using Graph Neural Networkscited by 1
- 2024Inferring Pluggable Types with Machine Learningcited by 0
- 2025TypyBench: Evaluating LLM Type Inference for Untyped Python Repositoriescited by 0
- 2025Automated Type Annotation in Python Using Large Language Modelscited by 0
- 2025Automated Type Annotation in Python Using Large Language Models1 Aug 2025
- 2025TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories28 Jul 2025
- 2025Call Me Maybe: Enhancing JavaScript Call Graph Construction using Graph Neural Networks22 Jun 2025
- 2025Treefix: Enabling Execution with a Tree of Prefixes21 Jan 2025
- 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?10 Aug 2024
- 2024Inferring Pluggable Types with Machine Learning21 Jun 2024
- 2024Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicates8 Feb 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Type Prediction With Program Decomposition and Fill-in-the-Type Training25 May 2023
- 2023An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graph17 Apr 2023
- 2023TypeT5: Seq2seq Type Inference using Static Analysis16 Mar 2023
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Models14 Mar 2023
17 more
- 2023LExecutor: Learning-Guided Execution5 Feb 2023
- 2022JEMMA: An Extensible Java Dataset for ML4Code Applications18 Dec 2022
- 2022AutoPruner: Transformer-Based Call Graph Pruning7 Sep 2022
- 2022Cross-Domain Evaluation of a Deep Learning-Based Type Inference System19 Aug 2022
- 2022Learning Program Representations with a Tree-Structured Transformer18 Aug 2022
- 2022Evaluating the Impact of Source Code Parsers on ML4SE Models17 Jun 2022
- 2022NatGen: Generative pre-training by "Naturalizing" source code15 Jun 2022
- 2022On Distribution Shift in Learning-based Bug Detectors21 Apr 2022
- 2022InCoder: A Generative Model for Code Infilling and Synthesis12 Apr 2022
- 2022Learning Program Semantics with Code Representations: An Empirical Study22 Mar 2022
- 2022Unveiling Project-Specific Bias in Neural Code Models19 Jan 2022
- 2021GraphSearchNet: Enhancing GNNs via Capturing Global Dependencies for Semantic Code Search4 Nov 2021
- 2021Cross-Lingual Transfer Learning for Statistical Type Inference1 Jul 2021
- 2021Self-Supervised Bug Detection and Repair26 May 2021
- 2021ManyTypes4Py: A Benchmark Python Dataset for Machine Learning-based Type Inference10 Apr 2021
- 2021PSIMiner: A Tool for Mining Rich Abstract Syntax Trees from Code23 Mar 2021
- 2021Type4Py: Practical Deep Similarity Learning-Based Type Inference for Python12 Jan 2021
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 53
- 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?cited by 40
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2021Type4Py: Practical Deep Similarity Learning-Based Type Inference for Pythoncited by 19
- 2021GraphSearchNet: Enhancing GNNs via Capturing Global Dependencies for Semantic Code Searchcited by 15
- 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
- 2024Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicatescited by 14
- 2023TypeT5: Seq2seq Type Inference using Static Analysiscited by 12
- 2022AutoPruner: Transformer-Based Call Graph Pruningcited by 11
- 2021ManyTypes4Py: A Benchmark Python Dataset for Machine Learning-based Type Inferencecited by 9
12 most cited of 29 All 29 (JSON)
- 2025Automated Type Annotation in Python Using Large Language Models1 Aug 2025
- 2025TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories28 Jul 2025
- 2025Call Me Maybe: Enhancing JavaScript Call Graph Construction using Graph Neural Networks22 Jun 2025
- 2025Treefix: Enabling Execution with a Tree of Prefixes21 Jan 2025
- 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?10 Aug 2024
- 2024Inferring Pluggable Types with Machine Learning21 Jun 2024
- 2024Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicates8 Feb 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Type Prediction With Program Decomposition and Fill-in-the-Type Training25 May 2023
- 2023An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graph17 Apr 2023
- 2023TypeT5: Seq2seq Type Inference using Static Analysis16 Mar 2023
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Models14 Mar 2023
12 newest of 29 All 29 (JSON)