Probabilistic model for code with decision trees

Author:

Raychev Veselin1,Bielik Pavol1,Vechev Martin1

Affiliation:

1. ETH Zurich, Switzerland

Abstract

In this paper we introduce a new approach for learning precise and general probabilistic models of code based on decision tree learning. Our approach directly benefits an emerging class of statistical programming tools which leverage probabilistic models of code learned over large codebases (e.g., GitHub) to make predictions about new programs (e.g., code completion, repair, etc). The key idea is to phrase the problem of learning a probabilistic model of code as learning a decision tree in a domain specific language over abstract syntax trees (called TGen). This allows us to condition the prediction of a program element on a dynamically computed context. Further, our problem formulation enables us to easily instantiate known decision tree learning algorithms such as ID3, but also to obtain new variants we refer to as ID3+ and E13, not previously explored and ones that outperform ID3 in prediction accuracy. Our approach is general and can be used to learn a probabilistic model of any programming language. We implemented our approach in a system called Deep3 and evaluated it for the challenging task of learning probabilistic models of JavaScript and Python. Our experimental results indicate that Deep3 predicts elements of JavaScript and Python code with precision above 82% and 69%, respectively. Further, Deep3 often significantly outperforms state-of-the-art approaches in overall prediction accuracy.

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Graphics and Computer-Aided Design,Software

Reference36 articles.

1. Mining idioms from source code

2. Suggesting accurate method and class names

3. M. Allamanis D. Tarlow A. D. Gordon and Y. Wei . Bimodal modelling of source code and natural language. In F. R. Bach and D. M. Blei editors ICML volume 37 of JMLR Proceedings pages 2123– 2132 . JMLR.org 2015. M. Allamanis D. Tarlow A. D. Gordon and Y. Wei. Bimodal modelling of source code and natural language. In F. R. Bach and D. M. Blei editors ICML volume 37 of JMLR Proceedings pages 2123–2132. JMLR.org 2015.

Cited by 99 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11

2. The “Code” of Ethics: A Holistic Audit of AI Code Generators;IEEE Transactions on Dependable and Secure Computing;2024-09

3. A Combined Approach of Program Analysis and Deep Learning for Code Completion;Scientific Journal of Technology;2024-08-21

4. A survey on robustness attacks for deep code models;Automated Software Engineering;2024-08-09

5. Transformers in source code generation: A comprehensive survey;Journal of Systems Architecture;2024-08

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3