跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 软件工程

arXiv:2105.03595 (cs)
[提交于 2022年2月10日]

标题:Static Inference Meets Deep Learning: A Hybrid Type Inference Approach for Python

作者:Yun Peng, Cuiyun Gao, Zongjie Li, Bowei Gao, David Lo, Qirun Zhang, Michael Lyu
查看论文《Static Inference Meets Deep Learning: A Hybrid Type Inference Approach for Python》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Type inference for dynamic programming languages such as Python is an important yet challenging task. Static type inference techniques can precisely infer variables with enough static constraints but are unable to handle variables with dynamic features. Deep learning (DL) based approaches are feature-agnostic, but they cannot guarantee the correctness of the predicted types. Their performance significantly depends on the quality of the training data (i.e., DL models perform poorly on some common types that rarely appear in the training dataset). It is interesting to note that the static and DL-based approaches offer complementary benefits. Unfortunately, to our knowledge, precise type inference based on both static inference and neural predictions has not been exploited and remains an open challenge. In particular, it is hard to integrate DL models into the framework of rule-based static approaches. This paper fills the gap and proposes a hybrid type inference approach named HiTyper based on both static inference and deep learning. Specifically, our key insight is to record type dependencies among variables in each function and encode the dependency information in type dependency graphs (TDGs). Based on TDGs, we can easily integrate type inference rules in the nodes to conduct static inference and type rejection rules to inspect the correctness of neural predictions. HiTyper iteratively conducts static inference and DL-based prediction until the TDG is fully inferred. Experiments on two benchmark datasets show that HiTyper outperforms state-of-the-art DL models by exactly matching 10% more human annotations. HiTyper also achieves an increase of more than 30% on inferring rare types. Considering only the static part of HiTyper, it infers 2x ~ 3x more types than existing static type inference tools.
评论: This paper has been accepted by 44th International Conference on Software Engineering (ICSE 2022)
主题: 软件工程 (cs.SE); 程序设计语言 (cs.PL)
引用方式: arXiv:2105.03595 [cs.SE]
  (或者 arXiv:2105.03595v1 [cs.SE] 对于此版本)
  https://doi.org/10.48550/arXiv.2105.03595
相关 DOI: https://doi.org/10.1145/3510003.3510038

提交历史

来自:Yun Peng
[v1] 2022年2月10日 星期四 00:00:00 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.SE
< 上一篇   |   下一篇 >
最新 | 近期 | 2022-02
切换浏览方式为:
cs
cs.PL

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站