Typilus: neural type hints
Miltiadis Allamanis, Earl T. Barr, Soline Ducousso, Zheng Gao
摘要
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.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper52
- Self-Supervised Bug Detection and RepairMiltiadis Allamanis, Henry Jackson-Flux, Marc BrockschmidtNeurIPS 2021 · 被引用 145 次
- TFix: Learning to Fix Coding Errors with a Text-to-Text TransformerBerkay Berabi, Jingxuan He, Veselin Raychev, Martin T. VechevICML 2021 · 被引用 143 次
- InCoder: A Generative Model for Code Infilling and SynthesisDaniel Fried, Armen Aghajanyan, Jessy Lin, Sida Wang 等ICLR 2023 · 被引用 140 次
- NatGen: generative pre-training by "naturalizing" source codeSaikat Chakraborty, Toufique Ahmed, Yangruibo Ding, Premkumar T. Devanbu 等FSE 2022 · 被引用 101 次
- Adversarial Robustness for CodePavol Bielik, Martin T. VechevICML 2020 · 被引用 101 次
它引用的顶会 Paper2
相关 Paper
- Type4Py: Practical Deep Similarity Learning-Based Type Inference for PythonAmir M. Mir, Evaldas Latoskinas, Sebastian Proksch, Georgios GousiosICSE 2022 · 被引用 59 次
- LambdaNet: Probabilistic Type Inference using Graph Neural NetworksJiayi Wei, Maruth Goyal, Greg Durrett, Isil DilligICLR 2020 · 被引用 119 次
- Statistical Type Inference for Incomplete ProgramsYaohui Peng, Jing Xie, Qiongling Yang, Hanwen Guo 等FSE 2023 · 被引用 2 次
- Dataflow-Guided Neuro-Symbolic Language Models for Type InferenceGe Li, Yao Wan, Hongyu Zhang, Zhou Zhao 等ICML 2025
- DLInfer: Deep Learning with Static Slicing for Python Type InferenceYanyan Yan, Yang Feng, Hongcheng Fan, Baowen XuICSE 2023 · 被引用 9 次
