Dataflow-Guided Neuro-Symbolic Language Models for Type Inference
Ge Li, Yao Wan, Hongyu Zhang, Zhou Zhao, Wenbin Jiang, Xuanhua Shi, Hai Jin, Zheng Wang
摘要
Language Models (LMs) are increasingly used for type inference, aiding in error detection and software development. Some real-world deployments of LMs require the model to run on local machines to safeguard the intellectual property of the source code. This setting often limits the size of the LMs that can be used. We present NESTER, the first neuro-symbolic approach that enhances LMs for type inference by integrating symbolic learning without increasing model size. NESTER breaks type inference into sub-tasks based on the data and control flow of the input code, encoding them as a modular high-level program. This program executes multi-step actions, such as evaluating expressions and analyzing conditional branches of the target code, combining static typing with LMs to infer potential types. Evaluated on the Many-Types4Py dataset in Python, NESTER outperforms two state-of-the-art type inference methods (Hi-Typer and TypeGen), achieving 70.7% Top-1 Exact Match, which is 18.3% and 3.6% higher than HiTyper and TypeGen, respectively. For complex type annotations like "typing.Optional" and "typing.Union", NESTER achieves 51.0% and 16.7%, surpassing TypeGen by 28.3% and 5.8%.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Chain of Preference Optimization: Improving Chain-of-Thought Reasoning in LLMs 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Towards Mitigating LLM Hallucination via Self Reflection 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
引用它的顶会 Paper1
它引用的 Paper19
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 次引用
- NExT-GPT: Any-to-Any Multimodal LLMShengqiong Wu, Hao Fei, Leigang Qu, Wei Ji 等ICML 2024 · 786 次引用
- Towards Mitigating LLM Hallucination via Self ReflectionZiwei Ji, Tiezheng Yu, Yan Xu, Nayeon Lee 等EMNLP Findings 2023 · 274 次引用
- Chain of Preference Optimization: Improving Chain-of-Thought Reasoning in LLMsXuan Zhang, Chao Du, Tianyu Pang, Qian Liu 等NeurIPS 2024 · 177 次引用
相关 Paper
- Type4Py: Practical Deep Similarity Learning-Based Type Inference for PythonAmir M. Mir, Evaldas Latoskinas, Sebastian Proksch, Georgios GousiosICSE 2022 · 59 次引用
- Static Inference Meets Deep learning: A Hybrid Type Inference Approach for PythonYun Peng, Cuiyun Gao, Zongjie Li, Bowei Gao 等ICSE 2022 · 48 次引用
- TypyBench: Evaluating LLM Type Inference for Untyped Python RepositoriesHonghua Dong, Jiacheng Yang, Xun Deng, Yuhe Jiang 等ICML 2025
- TypePro: Boosting LLM-Based Type Inference via Inter-Procedural SlicingTeyu Lin, Minghao Fan, Huaxun Huang, Zhirong Shen 等FSE 2026
- Automating Just-In-Time Python Type Annotation UpdatingZhipeng Xue, Zhipeng Gao, Xing Hu, Jingyuan Chen 等ICSE 2026
