Deep Learning Type Inference

被引:116
|
作者
Hellendoorn, Vincent J. [1 ]
Bird, Christian [2 ]
Barr, Earl T. [3 ]
Allamanis, Miltiadis [4 ]
机构
[1] Univ Calif Davis, Davis, CA 95616 USA
[2] Microsoft Res, Redmond, WA USA
[3] UCL, London, England
[4] Microsoft Res Cambridge, Cambridge, England
基金
美国国家科学基金会; 英国工程与自然科学研究理事会;
关键词
Type Inference; Deep Learning; Naturalness;
D O I
10.1145/3236024.3236051
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Dynamically typed languages such as JavaScript and Python are increasingly popular, yet static typing has not been totally eclipsed: Python now supports type annotations and languages like Type-Script offer a middle-ground for JavaScript: a strict superset of JavaScript, to which it transpiles, coupled with a type system that permits partially typed programs. However, static typing has a cost: adding annotations, reading the added syntax, and wrestling with the type system to fix type errors. Type inference can ease the transition to more statically typed code and unlock the benefits of richer compile-time information, but is limited in languages like JavaScript as it cannot soundly handle duck-typing or runtime evaluation via eval. We propose DEEPTYPER, a deep learning model that understands which types naturally occur in certain contexts and relations and can provide type suggestions, which can often be verified by the type checker, even if it could not infer the type initially. DEEPTYPER, leverages an automatically aligned corpus of tokens and types to accurately predict thousands of variable and function type annotations. Furthermore, we demonstrate that context is key in accurately assigning these types and introduce a technique to reduce overfitting on local cues while highlighting the need for further improvements. Finally, we show that our model can interact with a compiler to provide more than 4,000 additional type annotations with over 95% precision that could not be inferred without the aid of DEEPTYPER.
引用
收藏
页码:152 / 162
页数:11
相关论文
共 50 条
  • [1] Static Inference Meets Deep Learning: A Hybrid Type Inference Approach for Python']Python
    Peng, Yun
    Gao, Cuiyun
    Li, Zongjie
    Gao, Bowei
    Lo, David
    Zhang, Qirun
    Lyu, Michael
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 2019 - 2030
  • [2] DLInfer: Deep Learning with Static Slicing for Python']Python Type Inference
    Yan, Yanyan
    Feng, Yang
    Fan, Hongcheng
    Xu, Baowen
    2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 2009 - 2021
  • [3] Analog Inference Circuits for Deep Learning
    Holleman, Jeremy
    Arel, Itamar
    Young, Steven
    Lu, Junjie
    2015 IEEE BIOMEDICAL CIRCUITS AND SYSTEMS CONFERENCE (BIOCAS), 2015, : 129 - 132
  • [4] Deep Learning for Population Genetic Inference
    Sheehan, Sara
    Song, Yun S.
    PLOS COMPUTATIONAL BIOLOGY, 2016, 12 (03)
  • [5] A Primer on Deep Learning for Causal Inference
    Koch, Bernard J.
    Sainburg, Tim
    Geraldo Bastias, Pablo
    Jiang, Song
    Sun, Yizhou
    Foster, Jacob G.
    SOCIOLOGICAL METHODS & RESEARCH, 2024,
  • [6] Deep Learning Inference Service at Microsoft
    Soifer, Jonathan
    Li, Jason
    Li, Mingqin
    Zhu, Jeffrey
    Li, Yingnan
    He, Yuxiong
    PROCEEDINGS OF THE 2019 USENIX CONFERENCE ON OPERATIONAL MACHINE LEARNING, 2019, : 15 - 17
  • [7] Gene expression inference with deep learning
    Chen, Yifei
    Li, Yi
    Narayan, Rajiv
    Subramanian, Aravind
    Xie, Xiaohui
    BIOINFORMATICS, 2016, 32 (12) : 1832 - 1839
  • [8] A deep inference learning framework for healthcare
    Dai, Yinglong
    Wang, Guojun
    PATTERN RECOGNITION LETTERS, 2020, 139 : 17 - 25
  • [9] DLI: Deep Learning Inference Benchmark
    Kustikova, Valentina
    Vasiliev, Evgenii
    Khvatov, Alexander
    Kumbrasiev, Pavel
    Rybkin, Roman
    Kogteva, Nadezhda
    SUPERCOMPUTING (RUSCDAYS 2019), 2019, 1129 : 542 - 553
  • [10] Laconic Deep Learning Inference Acceleration
    Sharify, Sayeh
    Lascorz, Alberto Delmas
    Mahmoud, Mostafa
    Nikolic, Milos
    Siu, Kevin
    Stuart, Dylan Malone
    Poulos, Zissis
    Moshovos, Andreas
    PROCEEDINGS OF THE 2019 46TH INTERNATIONAL SYMPOSIUM ON COMPUTER ARCHITECTURE (ISCA '19), 2019, : 304 - 317