Programming with Neural Surrogates of Programs
- URL: http://arxiv.org/abs/2112.06148v1
- Date: Sun, 12 Dec 2021 04:45:41 GMT
- Title: Programming with Neural Surrogates of Programs
- Authors: Alex Renda, Yi Ding, Michael Carbin
- Abstract summary: We study three surrogate-based design patterns, evaluating each in case studies on a large-scale CPU simulator.
With surrogate compilation, programmers develop a surrogate that mimics the behavior of a program to deploy to end-users.
With surrogate adaptation, programmers develop a surrogate of a program then retrain that surrogate on a different task.
With surrogate optimization, programmers develop a surrogate of a program, optimize input parameters of the surrogate, then plug the optimized input parameters back into the original program.
- Score: 17.259433118432757
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Surrogates, models that mimic the behavior of programs, form the basis of a
variety of development workflows. We study three surrogate-based design
patterns, evaluating each in case studies on a large-scale CPU simulator.
With surrogate compilation, programmers develop a surrogate that mimics the
behavior of a program to deploy to end-users in place of the original program.
Surrogate compilation accelerates the CPU simulator under study by $1.6\times$.
With surrogate adaptation, programmers develop a surrogate of a program then
retrain that surrogate on a different task. Surrogate adaptation decreases the
simulator's error by up to $50\%$. With surrogate optimization, programmers
develop a surrogate of a program, optimize input parameters of the surrogate,
then plug the optimized input parameters back into the original program.
Surrogate optimization finds simulation parameters that decrease the
simulator's error by $5\%$ compared to the error induced by expert-set
parameters.
In this paper we formalize this taxonomy of surrogate-based design patterns.
We further describe the programming methodology common to all three design
patterns. Our work builds a foundation for the emerging class of workflows
based on programming with surrogates of programs.
Related papers
- Learning to Compile Programs to Neural Networks [10.203788801836385]
A $textitneural surrogate of a program$ is a neural network that mimics the behavior of a program.
We present a technique for producing neural surrogates directly from program text without coupling neural surrogate generation and execution.
arXiv Detail & Related papers (2024-07-21T07:04:52Z) - Learning to Reason via Program Generation, Emulation, and Search [33.11955431589091]
Program synthesis with language models (LMs) has unlocked a large set of reasoning abilities.
Not all reasoning tasks are easily expressible as code, e.g. tasks involving commonsense reasoning, moral decision-making, and sarcasm understanding.
We propose Code Generation and Emulated EXecution (CoGEX) to extend an LM's program synthesis skills to such tasks.
arXiv Detail & Related papers (2024-05-25T19:40:50Z) - NExT: Teaching Large Language Models to Reason about Code Execution [50.93581376646064]
Large language models (LLMs) of code are typically trained on the surface textual form of programs.
We propose NExT, a method to teach LLMs to inspect the execution traces of programs and reason about their run-time behavior.
arXiv Detail & Related papers (2024-04-23T01:46:32Z) - SOEN-101: Code Generation by Emulating Software Process Models Using Large Language Model Agents [50.82665351100067]
FlowGen is a code generation framework that emulates software process models based on multiple Large Language Model (LLM) agents.
We evaluate FlowGenScrum on four benchmarks: HumanEval, HumanEval-ET, MBPP, and MBPP-ET.
arXiv Detail & Related papers (2024-03-23T14:04:48Z) - Moving beyond Deletions: Program Simplification via Diverse Program
Transformations [11.038120567076772]
Developers manually simplify program (known as developer-induced program simplification in this paper) to reduce its code size yet preserving its functionality.
To reduce manual effort, rule-based approaches (e.g., deletion-based approaches) can be potentially applied to automate developer-induced program simplification.
We propose SimpT5, a tool that can automatically produce simplified programs (semantically-equivalent programs with reduced source lines of code)
Our evaluation shows that SimpT5 are more effective than prior approaches in automating developer-induced program simplification.
arXiv Detail & Related papers (2024-01-26T22:59:43Z) - Guess & Sketch: Language Model Guided Transpilation [59.02147255276078]
Learned transpilation offers an alternative to manual re-writing and engineering efforts.
Probabilistic neural language models (LMs) produce plausible outputs for every input, but do so at the cost of guaranteed correctness.
Guess & Sketch extracts alignment and confidence information from features of the LM then passes it to a symbolic solver to resolve semantic equivalence.
arXiv Detail & Related papers (2023-09-25T15:42:18Z) - Synthesis of Mathematical programs from Natural Language Specifications [0.0]
Decision problems that are encountered in various business domains can be modeled as mathematical programs, i.e. optimization problems.
The process of conducting such modeling often requires the involvement of experts trained in operations research and advanced algorithms.
In this work we evaluate the efficacy of employing CodeT5 with data augmentation and post-processing of beams.
We observe that with these enhancements CodeT5 base gives an execution accuracy of 0.73 which is significantly better than zero-shot execution accuracy of 0.41 by ChatGPT and 0.36 by Codex.
arXiv Detail & Related papers (2023-03-30T06:10:00Z) - Learning Performance-Improving Code Edits [107.21538852090208]
We introduce a framework for adapting large language models (LLMs) to high-level program optimization.
First, we curate a dataset of performance-improving edits made by human programmers of over 77,000 competitive C++ programming submission pairs.
For prompting, we propose retrieval-based few-shot prompting and chain-of-thought, and for finetuning, these include performance-conditioned generation and synthetic data augmentation based on self-play.
arXiv Detail & Related papers (2023-02-15T18:59:21Z) - CodeRL: Mastering Code Generation through Pretrained Models and Deep
Reinforcement Learning [92.36705236706678]
"CodeRL" is a new framework for program synthesis tasks through pretrained LMs and deep reinforcement learning.
During inference, we introduce a new generation procedure with a critical sampling strategy.
For the model backbones, we extended the encoder-decoder architecture of CodeT5 with enhanced learning objectives.
arXiv Detail & Related papers (2022-07-05T02:42:15Z) - Learning from Self-Sampled Correct and Partially-Correct Programs [96.66452896657991]
We propose to let the model perform sampling during training and learn from both self-sampled fully-correct programs and partially-correct programs.
We show that our use of self-sampled correct and partially-correct programs can benefit learning and help guide the sampling process.
Our proposed method improves the pass@k performance by 3.1% to 12.3% compared to learning from a single reference program with MLE.
arXiv Detail & Related papers (2022-05-28T03:31:07Z) - Generating Adversarial Computer Programs using Optimized Obfuscations [43.95037234252815]
We investigate principled ways to adversarially perturb a computer program to fool such learned models.
We use program obfuscations, which have conventionally been used to avoid attempts at reverse engineering programs.
We show that our best attack proposal achieves a $52%$ improvement over a state-of-the-art attack generation approach.
arXiv Detail & Related papers (2021-03-18T10:47:15Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.