Exploring Software Naturalness through Neural Language Models (2006.12641v2)
Abstract: The Software Naturalness hypothesis argues that programming languages can be understood through the same techniques used in natural language processing. We explore this hypothesis through the use of a pre-trained transformer-based LLM to perform code analysis tasks. Present approaches to code analysis depend heavily on features derived from the Abstract Syntax Tree (AST) while our transformer-based LLMs work on raw source code. This work is the first to investigate whether such LLMs can discover AST features automatically. To achieve this, we introduce a sequence labeling task that directly probes the LLMs understanding of AST. Our results show that transformer based LLMs achieve high accuracy in the AST tagging task. Furthermore, we evaluate our model on a software vulnerability identification task. Importantly, we show that our approach obtains vulnerability identification results comparable to graph based approaches that rely heavily on compilers for feature extraction.
- Luca Buratti (13 papers)
- Saurabh Pujar (14 papers)
- Mihaela Bornea (10 papers)
- Scott McCarley (6 papers)
- Yunhui Zheng (11 papers)
- Gaetano Rossiello (21 papers)
- Alessandro Morari (10 papers)
- Jim Laredo (8 papers)
- Veronika Thost (21 papers)
- Yufan Zhuang (16 papers)
- Giacomo Domeniconi (7 papers)