Lune

ICSE2022顶会

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 R. Lyu

摘要

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

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 30 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Generative Type Inference for Python 引用了 Typilus: neural type hints
  • Generative Type Inference for Python 引用了 Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errors
  • Generative Type Inference for Python 引用了 LambdaNet: Probabilistic Type Inference using Graph Neural Networks
  • Generative Type Inference for Python 引用了 TypeWriter: neural type prediction with search-based validation
  • Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errors 引用了 Typilus: neural type hints
  • AutoPruner: transformer-based call graph pruning 引用了 Typilus: neural type hints
  • AutoPruner: transformer-based call graph pruning 引用了 TypeWriter: neural type prediction with search-based validation
  • Balanced Meta-Softmax for Long-Tailed Visual Recognition 引用了 Decoupling Representation and Classifier for Long-Tailed Recognition
  • LExecutor: Learning-Guided Execution 引用了 Typilus: neural type hints
  • LExecutor: Learning-Guided Execution 引用了 LambdaNet: Probabilistic Type Inference using Graph Neural Networks
  • LExecutor: Learning-Guided Execution 引用了 TypeWriter: neural type prediction with search-based validation
  • DeepInfer: Deep Type Inference from Smart Contract Bytecode 引用了 Typilus: neural type hints
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper30

  1. Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type ErrorsYun Peng, Shuzheng Gao, Cuiyun Gao, Yintong Huo 等ICSE 2024 · 39 次引用
  2. Generative Type Inference for PythonYun Peng, Chaozheng Wang, Wenxuan Wang, Cuiyun Gao 等ASE 2023 · 29 次引用
  3. DeepInfer: Deep Type Inference from Smart Contract BytecodeKunsong Zhao, Zihao Li, Jianfeng Li, He Ye 等FSE 2023 · 24 次引用
  4. AutoPruner: transformer-based call graph pruningThanh Le-Cong, Hong Jin Kang, Truong Giang Nguyen, Stefanus Agus Haryono 等FSE 2022 · 21 次引用
  5. LExecutor: Learning-Guided ExecutionBeatriz Souza, Michael PradelFSE 2023 · 16 次引用

它引用的 Paper9

  1. Decoupling Representation and Classifier for Long-Tailed RecognitionBingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan 等ICLR 2020 · 1,496 次引用
  2. Balanced Meta-Softmax for Long-Tailed Visual RecognitionJiawei Ren, Cunjun Yu, Shunan Sheng, Xiao Ma 等NeurIPS 2020 · 861 次引用
  3. LambdaNet: Probabilistic Type Inference using Graph Neural NetworksJiayi Wei, Maruth Goyal, Greg Durrett, Isil DilligICLR 2020 · 119 次引用
  4. TypeWriter: neural type prediction with search-based validationMichael Pradel, Georgios Gousios, Jason Liu, Satish ChandraFSE 2020 · 102 次引用
  5. Typilus: neural type hintsMiltiadis Allamanis, Earl T. Barr, Soline Ducousso, Zheng GaoPLDI 2020 · 92 次引用

相关 Paper

  1. TypePro: Boosting LLM-Based Type Inference via Inter-Procedural SlicingTeyu Lin, Minghao Fan, Huaxun Huang, Zhirong Shen 等FSE 2026
  2. DLInfer: Deep Learning with Static Slicing for Python Type InferenceYanyan Yan, Yang Feng, Hongcheng Fan, Baowen XuICSE 2023 · 9 次引用
  3. Type4Py: Practical Deep Similarity Learning-Based Type Inference for PythonAmir M. Mir, Evaldas Latoskinas, Sebastian Proksch, Georgios GousiosICSE 2022 · 59 次引用
  4. Dataflow-Guided Neuro-Symbolic Language Models for Type InferenceGe Li, Yao Wan, Hongyu Zhang, Zhou Zhao 等ICML 2025
  5. Static Type Recommendation for PythonKe Sun, Yifan Zhao, Dan Hao, Lu ZhangASE 2022 · 6 次引用
黄昏的海面,两侧是细线勾勒的悬崖