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 条
  • [31] 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
  • [32] Privacy-Preserving Deep Learning and Inference
    Riazi, M. Sadegh
    Koushanfar, Farinaz
    2018 IEEE/ACM INTERNATIONAL CONFERENCE ON COMPUTER-AIDED DESIGN (ICCAD) DIGEST OF TECHNICAL PAPERS, 2018,
  • [33] Harnessing deep learning for population genetic inference
    Huang, Xin
    Rymbekova, Aigerim
    Dolgova, Olga
    Lao, Oscar
    Kuhlwilm, Martin
    NATURE REVIEWS GENETICS, 2024, 25 (01) : 61 - 78
  • [34] Deep Learning Approach to Biogeographical Ancestry Inference
    Qu, Yue
    Tran, Dat
    Ma, Wanli
    KNOWLEDGE-BASED AND INTELLIGENT INFORMATION & ENGINEERING SYSTEMS (KES 2019), 2019, 159 : 552 - 561
  • [35] A Chiplet Prototype System for Deep Learning Inference
    Jerger, Natalie Enright
    COMMUNICATIONS OF THE ACM, 2021, 64 (06) : 106 - 106
  • [36] Harnessing deep learning for population genetic inference
    Xin Huang
    Aigerim Rymbekova
    Olga Dolgova
    Oscar Lao
    Martin Kuhlwilm
    Nature Reviews Genetics, 2024, 25 : 61 - 78
  • [37] LEARNING PERCEPTION AND PLANNING WITH DEEP ACTIVE INFERENCE
    Catal, Ozan
    Verbelen, Tim
    Nauta, Johannes
    De Boom, Cedric
    Dhoedt, Bart
    2020 IEEE INTERNATIONAL CONFERENCE ON ACOUSTICS, SPEECH, AND SIGNAL PROCESSING, 2020, : 3952 - 3956
  • [38] Anatomizing Deep Learning Inference in Web Browsers
    Wang, Qipeng
    Jiang, Shiqi
    Chen, Zhenpeng
    Cao, Xu
    Li, Yuanchun
    Li, Aoyu
    Ma, Yun
    Cao, Ting
    Liu, Xuanzhe
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2025, 34 (02)
  • [39] Evaluating Approximate Inference in Bayesian Deep Learning
    Wilson, Andrew Gordon
    Lotfi, Sanae
    Vikram, Sharad
    Hoffman, Matthew D.
    Gal, Yarin
    Li, Yingzhen
    Pradier, Melanie F.
    Foong, Andrew
    Farquhar, Sebastian
    Izmailov, Pavel
    NEURIPS 2021 COMPETITIONS AND DEMONSTRATIONS TRACK, VOL 176, 2021, 176 : 113 - 124
  • [40] INFERENCE ACCELERATION OF DEEP LEARNING CLASSIFIERS BASED ON RNN
    Keddous, Fekhr Eddine
    Shvai, Nadiya
    Llanza, Arcadi
    Nakib, Amir
    2023 IEEE INTERNATIONAL CONFERENCE ON IMAGE PROCESSING, ICIP, 2023, : 2450 - 2454