A Deep Learning Model for Predicting Transformation Legality
Not on the map. Why?
Abstract (arXiv)
Compilers must check the legality of code transformations to guarantee the correctness of applying a sequence of code transformations to a given code. While such a legality check needs to be precisely computed in general, we can use an approximate legality prediction model in certain cases, such as training a reinforcement learning (RL) agent for schedule prediction. In this paper, we propose an approximate method for legality checks. We propose a novel DL model for predicting the legality of transformations. The model takes the code representation and a list of transformations as input and predicts whether applying those transformations to the code is legal. We implement and evaluate the proposed model, demonstrating its effectiveness. Our evaluation shows an F1 score of 0.91 on a test set of randomly generated programs. To further evaluate the model in a practical scenario, we used the model to replace the legality check used during the training of an RL agent designed for automatic code optimization. We demonstrate that such a replacement enables the agent to train on twice as many steps, resulting in faster training and reducing resource usage by approximately 80% for CPU and 35% for RAM. The agent trained using this approach maintains comparable performance, with only a 4% reduction on benchmarks from the Polybench suite compared to the traditional method.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 12 of its 28 references that are in the map. First posted on arXiv 8 Nov 2025.
Builds on
12 of 28 references.
References · 12
- 2018Learning to Optimize Tensor Programscited by 140
- 2017Device Placement Optimization with Reinforcement Learningcited by 86
- 2018Neural Code Comprehension: A Learnable Representation of Code Semanticscited by 59
- 2021CompilerGym: Robust, Performant Compiler Optimization Environments for AI Researchcited by 41
- 2018A Survey on Compiler Autotuning using Machine Learningcited by 40
- 2021MLGO: a Machine Learning Guided Compiler Optimizations Frameworkcited by 40
- 2019NeuroVectorizer: End-to-End Vectorization with Deep Reinforcement Learningcited by 37
- 2021A Deep Learning Based Cost Model for Automatic Code Optimizationcited by 33
- 2020ProGraML: Graph-based Deep Learning for Program Optimization and Analysiscited by 23
- 2019AutoPhase: Compiler Phase-Ordering for High Level Synthesis with Deep Reinforcement Learningcited by 12
- 2024LOOPer: A Learned Automatic Code Optimizer For Polyhedral Compilerscited by 7
- 2023LoopTune: Optimizing Tensor Computations with Reinforcement Learningcited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2023The "code'' of Ethics:A Holistic Audit of AI Code Generators
- 2026CVeDRL: An Efficient Code Verifier via Difficulty-aware Reinforcement Learning
- 2026EvolveCoder: Evolving Test Cases via Adversarial Verification for Code Reinforcement Learning
- 2026Combinatorial Synthesis: Scaling Code RLVR via Atomic Decomposition and Recombination
- 2026Converted, Not Equivalent: Benchmarking Codebase Conversion via Observational Equivalence
- 2025Training Language Models to Generate Quality Code with Program Analysis Feedback
- 2026Reinforcement Learning for Code Optimization
- 2024Enhancing Code LLMs with Reinforcement Learning in Code Generation: A Survey