Learning to Compile Programs to Neural Networks
Logan Weber, Jesse Michel, Alex Renda, Michael Carbin
Abstract
A is a neural network that mimics the behavior of a program. Researchers have used these neural surrogates to automatically tune program inputs, adapt programs to new settings, and accelerate computations. Researchers traditionally develop neural surrogates by training on input-output examples from a single program. Alternatively, language models trained on a large dataset including many programs can consume program text, to act as a neural surrogate. Using a language model to both generate a surrogate and act as a surrogate, however, leading to a trade-off between resource consumption and accuracy. We present , a technique for producing neural surrogates directly from program text without coupling neural surrogate generation and execution. We implement neural surrogate compilers using hypernetworks trained on a dataset of C programs and find that they produce neural surrogates that are - as data-efficient, produce visual results that are - more similar to ground truth, and train in - fewer epochs than neural surrogates trained from scratch.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
Builds on3
- CRUXEval: A Benchmark for Code Reasoning, Understanding and ExecutionAlex Gu, Baptiste Rozière, Hugh James Leather, Armando Solar-Lezama et al.ICML 2024 · 270 citations
- Looped Transformers as Programmable ComputersAngeliki Giannou, Shashank Rajput, Jy-yong Sohn, Kangwook Lee et al.ICML 2023 · 175 citations
- Learning to Execute Programs with Instruction Pointer Attention Graph Neural NetworksDavid Bieber, Charles Sutton, Hugo Larochelle, Daniel TarlowNeurIPS 2020 · 51 citations
Related papers
- Turaco: Complexity-Guided Data Sampling for Training Neural Surrogates of ProgramsAlex Renda, Yi Ding, Michael CarbinOOPSLA 2023
- Surge: On the Potential of Large Language Models as General-Purpose Surrogate Code ExecutorsBohan Lyu, Siqiao Huang, Zichen Liang, Qian Sun et al.EMNLP 2025
- Introducing Compiler Semantics into Large Language Models as Programming Language Translators: A Case Study of C to x86 AssemblyShuoming Zhang, Jiacheng Zhao, Chunwei Xia, Zheng Wang et al.EMNLP Findings 2024 · 1 citation
- Auto-HPCnet: An Automatic Framework to Build Neural Network-based Surrogate for High-Performance Computing ApplicationsWenqian Dong, Gokcen Kestor, Dong LiHPDC 2023 · 6 citations
- HYSYNTH: Context-Free LLM Approximation for Guiding Program SynthesisShraddha Barke, Emmanuel Anaya Gonzalez, Saketh Ram Kasibatla, Taylor Berg-Kirkpatrick et al.NeurIPS 2024 · 34 citations
