OptTyper: Probabilistic Type Inference by Optimising Logical and Natural Constraints
Not on the map. Why?
Abstract (arXiv)
We present a new approach to the type inference problem for dynamic languages. Our goal is to combine logical constraints, that is, deterministic information from a type system, with natural constraints, that is, uncertain statistical information about types learnt from sources like identifier names. To this end, we introduce a framework for probabilistic type inference that combines logic and learning: logical constraints on the types are extracted from the program, and deep learning is applied to predict types from surface-level code properties that are statistically associated. The foremost insight of our method is to constrain the predictions from the learning procedure to respect the logical constraints, which we achieve by relaxing the logical inference problem of type prediction into a continuous optimisation problem. We build a tool called OptTyper to predict missing types for TypeScript files. OptTyper combines a continuous interpretation of logical constraints derived by classical static analysis of TypeScript code, with natural constraints obtained from a deep learning model, which learns naming conventions for types from a large codebase. By evaluating OptTyper, we show that the combination of logical and natural constraints yields a large improvement in performance over either kind of information individually and achieves a 4% improvement over the state-of-the-art.
Key facts. Cited by 14 papers in the map (data through 7 Oct 2026). First posted on arXiv 1 Apr 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 3; 2022: 2; 2023: 5; 2024: 2; 2025: 1; 2026: 1.
14 papers.
Sort:
By area:
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2021Type4Py: Practical Deep Similarity Learning-Based Type Inference for Pythoncited by 19
- 2023TypeT5: Seq2seq Type Inference using Static Analysiscited by 12
- 2022CodeQueries: A Dataset of Semantic Queries over Codecited by 11
- 2021ProtoTransformer: A Meta-Learning Approach to Providing Student Feedbackcited by 8
- 2023Type Prediction With Program Decomposition and Fill-in-the-Type Trainingcited by 6
- 2024Understanding How CodeLLMs (Mis)Predict Types with Activation Steeringcited by 4
- 2026AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AIcited by 2
- 2022Cross-Domain Evaluation of a Deep Learning-Based Type Inference Systemcited by 1
- 2024The Power of Types: Exploring the Impact of Type Checking on Neural Bug Detection in Dynamically Typed Languagescited by 1
2 more
- 2026AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AI21 Feb 2026
- 2025Automated Type Annotation in Python Using Large Language Models1 Aug 2025
- 2024The Power of Types: Exploring the Impact of Type Checking on Neural Bug Detection in Dynamically Typed Languages22 Nov 2024
- 2024Understanding How CodeLLMs (Mis)Predict Types with Activation Steering2 Apr 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Code14 Nov 2023
- 2023Learning Type Inference for Enhanced Dataflow Analysis1 Oct 2023
- 2023Type Prediction With Program Decomposition and Fill-in-the-Type Training25 May 2023
- 2023TypeT5: Seq2seq Type Inference using Static Analysis16 Mar 2023
- 2022CodeQueries: A Dataset of Semantic Queries over Code17 Sep 2022
- 2022Cross-Domain Evaluation of a Deep Learning-Based Type Inference System19 Aug 2022
- 2021Program Synthesis with Large Language Models16 Aug 2021
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2021Type4Py: Practical Deep Similarity Learning-Based Type Inference for Pythoncited by 19
- 2023TypeT5: Seq2seq Type Inference using Static Analysiscited by 12
- 2022CodeQueries: A Dataset of Semantic Queries over Codecited by 11
- 2021ProtoTransformer: A Meta-Learning Approach to Providing Student Feedbackcited by 8
- 2023Type Prediction With Program Decomposition and Fill-in-the-Type Trainingcited by 6
- 2024Understanding How CodeLLMs (Mis)Predict Types with Activation Steeringcited by 4
- 2022Cross-Domain Evaluation of a Deep Learning-Based Type Inference Systemcited by 1
- 2024The Power of Types: Exploring the Impact of Type Checking on Neural Bug Detection in Dynamically Typed Languagescited by 1
- 2023Learning Type Inference for Enhanced Dataflow Analysiscited by 0
12 most cited of 13 All 13 (JSON)
- 2025Automated Type Annotation in Python Using Large Language Models1 Aug 2025
- 2024The Power of Types: Exploring the Impact of Type Checking on Neural Bug Detection in Dynamically Typed Languages22 Nov 2024
- 2024Understanding How CodeLLMs (Mis)Predict Types with Activation Steering2 Apr 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Code14 Nov 2023
- 2023Learning Type Inference for Enhanced Dataflow Analysis1 Oct 2023
- 2023Type Prediction With Program Decomposition and Fill-in-the-Type Training25 May 2023
- 2023TypeT5: Seq2seq Type Inference using Static Analysis16 Mar 2023
- 2022CodeQueries: A Dataset of Semantic Queries over Code17 Sep 2022
- 2022Cross-Domain Evaluation of a Deep Learning-Based Type Inference System19 Aug 2022
- 2021Program Synthesis with Large Language Models16 Aug 2021
- 2021ProtoTransformer: A Meta-Learning Approach to Providing Student Feedback23 Jul 2021
12 newest of 13 All 13 (JSON)