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 条
  • [21] Collaborative Inference for Mobile Deep Learning Applications
    Yang, Qinglin
    Luo, Xiaofei
    Li, Peng
    Miyazaki, Toshiaki
    2ND INTERNATIONAL CONFERENCE ON 5G FOR UBIQUITOUS CONNECTIVITY, 5GU 2018, 2020, : 1 - 12
  • [22] When causal inference meets deep learning
    Yunan Luo
    Jian Peng
    Jianzhu Ma
    Nature Machine Intelligence, 2020, 2 : 426 - 427
  • [23] Scalable Deep Learning Inference: Algorithmic Approach
    Cho, Minsik
    2020 IEEE 34TH INTERNATIONAL PARALLEL AND DISTRIBUTED PROCESSING SYMPOSIUM WORKSHOPS (IPDPSW 2020), 2020, : 990 - 990
  • [24] A deep learning approach for complex microstructure inference
    Durmaz, Ali Riza
    Mueller, Martin
    Lei, Bo
    Thomas, Akhil
    Britz, Dominik
    Holm, Elizabeth A.
    Eberl, Chris
    Mucklich, Frank
    Gumbsch, Peter
    NATURE COMMUNICATIONS, 2021, 12 (01)
  • [26] When causal inference meets deep learning
    Luo, Yunan
    Peng, Jian
    Ma, Jianzhu
    NATURE MACHINE INTELLIGENCE, 2020, 2 (08) : 426 - 427
  • [27] Symbolic Task Inference in Deep Reinforcement Learning
    Hasanbeig, Hosein
    Jeppu, Natasha Yogananda
    Abate, Alessandro
    Melham, Tom
    Kroening, Daniel
    Journal of Artificial Intelligence Research, 2024, 80 : 1099 - 1137
  • [28] Accelerating Deep Learning Inference on Mobile Systems
    Frajberg, Darian
    Bernaschina, Carlo
    Marone, Christian
    Fraternali, Piero
    ARTIFICIAL INTELLIGENCE AND MOBILE SERVICES - AIMS 2019, 2019, 11516 : 118 - 134
  • [29] A deep learning approach for complex microstructure inference
    Ali Riza Durmaz
    Martin Müller
    Bo Lei
    Akhil Thomas
    Dominik Britz
    Elizabeth A. Holm
    Chris Eberl
    Frank Mücklich
    Peter Gumbsch
    Nature Communications, 12
  • [30] Bayesian Deep Learning via Subnetwork Inference
    Daxberger, Erik
    Nalisnick, Eric
    Allingham, James Urquhart
    Antoran, Javier
    Hernandez-Lobato, Jose Miguel
    INTERNATIONAL CONFERENCE ON MACHINE LEARNING, VOL 139, 2021, 139