Type Prediction With Program Decomposition and Fill-in-the-Type Training
Not on the map. Why?
Abstract (arXiv)
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, produce a well-typed output program. Large language models (LLMs) are promising for type prediction, but there are challenges: fill-in-the-middle performs poorly, programs may not fit into the context window, generated types may not type check, and it is difficult to measure how well-typed the output program is. We address these challenges by building OpenTau, a search-based approach for type prediction that leverages large language models. We propose a new metric for type prediction quality, give a tree-based program decomposition that searches a space of generated types, and present fill-in-the-type fine-tuning for LLMs. We evaluate our work with a new dataset for TypeScript type prediction, and show that 47.4% of files type check (14.5% absolute improvement) with an overall rate of 3.3 type errors per file. All code, data, and models are available at: https://github.com/GammaTauAI/opentau.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 29 of its 66 references that are in the map. First posted on arXiv 25 May 2023.
Builds on
29 of 66 references.
References · 29
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 820
- 2023StarCoder: may the source be with you!cited by 790
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2023SantaCoder: don't reach for the stars!cited by 169
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
17 more
- 2021Do Long-Range Language Models Actually Use Long-Range Context?cited by 92
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
- 2022PanGu-Coder: Program Synthesis with Function-Level Language Modelingcited by 47
- 2020LambdaNet: Probabilistic Type Inference using Graph Neural Networkscited by 44
- 2019TypeWriter: Neural Type Prediction with Search-based Validationcited by 32
- 2020Typilus: Neural Type Hintscited by 29
- 2021Type4Py: Practical Deep Similarity Learning-Based Type Inference for Pythoncited by 19
- 2020OptTyper: Probabilistic Type Inference by Optimising Logical and Natural Constraintscited by 14
- 2021ManyTypes4Py: A Benchmark Python Dataset for Machine Learning-based Type Inferencecited by 9
- 2023Do Machine Learning Models Produce TypeScript Types That Type Check?cited by 6
- 2021PYInfer: Deep Learning Semantic Type Inference for Python Variablescited by 4
- 2021Solver-based Gradual Type Migrationcited by 3
- 2016Type Inference for Static Compilation of JavaScript (Extended Version)cited by 2
- 2018Dynamic Type Inference for Gradual Hindley--Milner Typingcited by 1
- 2018Practical Optional Types for Clojurecited by 1
- 2021A Gradual Type System for Elixircited by 1
- 2022Gradual Soundness: Lessons from Static Pythoncited by 1
Built on by
Citing papers per year: 2023: 2; 2024: 2; 2025: 1; 2026: 1.
6 papers.
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2023Knowledge Transfer from High-Resource to Low-Resource Programming Languages for Code LLMscited by 45
- 2024VerMCTS: Synthesizing Multi-Step Programs using a Verifier, a Large Language Model, and Tree Searchcited by 13
- 2026AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AIcited by 2
- 2024The Power of Types: Exploring the Impact of Type Checking on Neural Bug Detection in Dynamically Typed Languagescited by 1
- 2025TypyBench: Evaluating LLM Type Inference for Untyped Python Repositoriescited by 0
- 2026AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AI21 Feb 2026
- 2025TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories28 Jul 2025
- 2024The Power of Types: Exploring the Impact of Type Checking on Neural Bug Detection in Dynamically Typed Languages22 Nov 2024
- 2024VerMCTS: Synthesizing Multi-Step Programs using a Verifier, a Large Language Model, and Tree Search13 Feb 2024
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Code14 Nov 2023
- 2023Knowledge Transfer from High-Resource to Low-Resource Programming Languages for Code LLMs19 Aug 2023