Werner Dietl
wdietl@uwaterloo.ca, Room EIT 4007
OppropBERL: A GNN and BERT-style Reinforcement Learning-based Type Inference System
“OppropBERL: A GNN and BERT-style Reinforcement Learning-based Type Inference System” by P. Jha and W. Dietl. In IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) short papers, Mar. 2024.
Abstract
Main-stream type systems do not prevent errors such as null-pointer exceptions, security problems, and concurrency errors. Optional Properties (Opprop) or pluggable type systems provide frameworks where users can guarantee a particular property holds with the help of a customizable type checker. Type annotations are used to specify a property, e.g., whether a reference can be null or not, and custom type rules enforce that property. However, manually inserting these type annotations for new and existing large projects requires a lot of human effort. Inference systems provide a constraintbased whole-program inference framework. However, thoroughly understanding the underlying framework to develop such a system is time-consuming. Furthermore, these frameworks make expensive calls to SAT and SMT solvers, which increases the runtime overhead during inference. Type system developers write test cases to ensure their type checker covers all the necessary type rules and works as expected. Our core idea is to leverage these manually written test cases along with the type checker to create a Deep Learning model to learn the type rules implicitly using a data-driven approach to automatically infer annotations for programs.
We present a novel model, OppropBERL, which takes as input a Java program to predict the appropriate type annotations for a given type system. The pre-trained Transformer model helps encode the code tokens without specifying the programming language's grammar, including the type rules. In the presence of a type checker, the model can be refined further using a reinforcement learning (RL) technique. With comprehensive experiments, we establish the efficacy of OppropBERL for nullness and ownership annotation prediction tasks by comparing against 8 different tools on publicly available Java projects with around 240K lines of code.
BibTeX entry:
@inproceedings{JhaDietl24, author = {P. Jha and W. Dietl}, title = {{OppropBERL: A GNN and BERT-style Reinforcement Learning-based Type Inference System}}, booktitle = {IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) short papers}, month = mar, }
Copyright notice: This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each author’s copyright. In most cases, these works may not be reposted without the explicit permission of the copyright holder.
(This webpage was created with bibtex2web.)