mlsanityData to 14 Oct 2026

TypeWriter: Neural Type Prediction with Search-based Validation

arXiv 1912.03768 ↗First posted 8 Dec 2019cs.SEcited by 32

Not on the map. Why?

Abstract (arXiv)

Maintaining large code bases written in dynamically typed languages, such as JavaScript or Python, can be challenging due to the absence of type annotations: simple data compatibility errors proliferate, IDE support is limited, and APIs are hard to comprehend. Recent work attempts to address those issues through either static type inference or probabilistic type prediction. Unfortunately, static type inference for dynamic languages is inherently limited, while probabilistic approaches suffer from imprecision. This paper presents TypeWriter, the first combination of probabilistic type prediction with search-based refinement of predicted types. TypeWriter's predictor learns to infer the return and argument types for functions from partially annotated code bases by combining the natural language properties of code with programming language-level information. To validate predicted types, TypeWriter invokes a gradual type checker with different combinations of the predicted types, while navigating the space of possible type combinations in a feedback-directed manner. We implement the TypeWriter approach for Python and evaluate it on two code corpora: a multi-million line code base at Facebook and a collection of 1,137 popular open-source projects. We show that TypeWriter's type predictor achieves an F1 score of 0.64 (0.79) in the top-1 (top-5) predictions for return types, and 0.57 (0.80) for argument types, which clearly outperforms prior type prediction models. By combining predictions with search-based validation, TypeWriter can fully annotate between 14% to 44% of the files in a randomly selected corpus, while ensuring type correctness. A comparison with a static type inference tool shows that TypeWriter adds many more non-trivial types. TypeWriter currently suggests types to developers at Facebook and several thousands of types have already been accepted with minimal changes.

Key facts. Cited by 32 papers in the map (data through 14 Oct 2026). First posted on arXiv 8 Dec 2019.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2021: 6; 2022: 7; 2023: 10; 2024: 3; 2025: 4; 2026: 2.

32 papers.

Sort:

By area:

  1. 2021Program Synthesis with Large Language Modelscited by 3,637
  2. 2023StarCoder: may the source be with you!cited by 799
  3. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
  4. 2023SantaCoder: don't reach for the stars!cited by 170
  5. 2022MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generationcited by 136
  6. 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?cited by 42
  7. 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Codecited by 39
  8. 2021Counterfactual Explanations for Models of Codecited by 25
  9. 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
  10. 2021Type4Py: Practical Deep Similarity Learning-Based Type Inference for Pythoncited by 19
  11. 2023TypeT5: Seq2seq Type Inference using Static Analysiscited by 12
  12. 2022AutoPruner: Transformer-Based Call Graph Pruningcited by 11
20 more
  1. 2022CodeQueries: A Dataset of Semantic Queries over Codecited by 11
  2. 2024Studying LLM Performance on Closed- and Open-source Datacited by 11
  3. 2021ManyTypes4Py: A Benchmark Python Dataset for Machine Learning-based Type Inferencecited by 9
  4. 2023Coeditor: Leveraging Contextual Changes for Multi-round Code Auto-editingcited by 9
  5. 2023LExecutor: Learning-Guided Executioncited by 7
  6. 2023Type Prediction With Program Decomposition and Fill-in-the-Type Trainingcited by 6
  7. 2022NeuDep: Neural Binary Memory Dependence Analysiscited by 3
  8. 2021Cross-Lingual Transfer Learning for Statistical Type Inferencecited by 2
  9. 2025Treefix: Enabling Execution with a Tree of Prefixescited by 2
  10. 2026Doc2Spec: Synthesizing Formal Programming Specifications from Natural Language via Grammar Inductioncited by 2
  11. 2026AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AIcited by 2
  12. 2022Cross-Domain Evaluation of a Deep Learning-Based Type Inference Systemcited by 1
  13. 2025Call Me Maybe: Enhancing JavaScript Call Graph Construction using Graph Neural Networkscited by 1
  14. 2021Report of the Workshop on Program Synthesis for Scientific Computingcited by 0
  15. 2023Serenity: Library Based Python Code Analysis for Code Completion and Automated Machine Learningcited by 0
  16. 2023Learning Type Inference for Enhanced Dataflow Analysiscited by 0
  17. 2023DocGen: Generating Detailed Parameter Docstrings in Pythoncited by 0
  18. 2024Inferring Pluggable Types with Machine Learningcited by 0
  19. 2025TypyBench: Evaluating LLM Type Inference for Untyped Python Repositoriescited by 0
  20. 2025Automated Type Annotation in Python Using Large Language Modelscited by 0