Valg: A Fast Reinforcement Learning Based Runtime Verification Tool for Java
Abstract
Runtime Verification (RV) dynamically monitors whether traces—sequences of program events like method calls—violate formal specifications. RV helped find many bugs, but it incurs high runtime overheads. Prior work showed that 99.87% of monitored traces are redundant: they are identical to the other 0.13%. So, we recently proposed a new technique based on reinforcement learning (RL) to speed up RV by reducing redundant monitoring. This paper presents Valg, a tool that implements the technique for Java. Compared to our previous prototype, Valg adds (i) per-spec hyperparameters, (ii) RL trajectory saving, (iii) offline hyperparameter tuning, and (iv) performance optimizations. We also integrate Valg with the main development branch of JavaMOP and TraceMOP, two state-of-the-art RV tools, and fix a long-standing specification bug. On 56 open-source projects, Valg with tuned hyperparameters is up to 4.2x and 1.9x faster than our prototype when applied to JavaMOP and TraceMOP, respectively, and improves unique trace preservation by up to 94.5pp. Valg’s offline hyperparameter tuning is orders of magnitude faster than our prototype’s online tuning, and our optimizations make JavaMOP, TraceMOP, and Valg faster. Valg is open-sourced at: https://github.com/SoftEngResearch/tracemop, and a video demo can be found at: https://youtu.be/_QCyHaa_ICc.
Publication details
- Journal / source
- Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering
- Publisher
- ACM
- Pages
- 119–122
- Publication date
- 12 April 2026