Learning to Improve Code Efficiency
Not on the map. Why?
Abstract (arXiv)
Improvements in the performance of computing systems, driven by Moore's Law, have transformed society. As such hardware-driven gains slow down, it becomes even more important for software developers to focus on performance and efficiency during development. While several studies have demonstrated the potential from such improved code efficiency (e.g., 2x better generational improvements compared to hardware), unlocking these gains in practice has been challenging. Reasoning about algorithmic complexity and the interaction of coding patterns on hardware can be challenging for the average programmer, especially when combined with pragmatic constraints around development velocity and multi-person development. This paper seeks to address this problem. We analyze a large competitive programming dataset from the Google Code Jam competition and find that efficient code is indeed rare, with a 2x runtime difference between the median and the 90th percentile of solutions. We propose using machine learning to automatically provide prescriptive feedback in the form of hints, to guide programmers towards writing high-performance code. To automatically learn these hints from the dataset, we propose a novel discrete variational auto-encoder, where each discrete latent variable represents a different learned category of code-edit that increases performance. We show that this method represents the multi-modal space of code efficiency edits better than a sequence-to-sequence baseline and generates a distribution of more efficient solutions.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 21 of its 34 references that are in the map. First posted on arXiv 9 Aug 2022.
Builds on
21 of 34 references.
References · 21
- 2017Attention Is All You Needcited by 60,361
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2017Neural Discrete Representation Learningcited by 4,712
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2016Categorical Reparameterization with Gumbel-Softmaxcited by 2,739
- 2016The Concrete Distribution: A Continuous Relaxation of Discrete Random Variablescited by 1,148
- 2021Carbon Emissions and Large Neural Network Trainingcited by 567
- 2016DeepCoder: Learning to Write Programscited by 149
- 2017RobustFill: Neural Program Learning under Noisy I/Ocited by 126
- 2020Graph-based, Self-Supervised Program Repair from Diagnostic Feedbackcited by 94
- 2016Neuro-Symbolic Program Synthesiscited by 84
9 more
- 2018Leveraging Grammar and Reinforcement Learning for Neural Program Synthesiscited by 84
- 2019Neo: A Learned Query Optimizercited by 80
- 2019Learning to Infer Program Sketchescited by 44
- 2018Neural-Guided Deductive Search for Real-Time Program Synthesis from Examplescited by 39
- 2018Learning to Optimize Join Queries With Deep Reinforcement Learningcited by 32
- 2017Neural Program Meta-Inductioncited by 23
- 2015deltaBLEU: A Discriminative Metric for Generation Tasks with Intrinsically Diverse Targetscited by 21
- 2020Learning to Represent Programs with Property Signaturescited by 16
- 2019Neural Networks for Modeling Source Code Editscited by 3
Built on by
Citing papers per year: 2023: 2; 2024: 2.
4 papers.
- 2023Learning Performance-Improving Code Editscited by 106
- 2024Mercury: A Code Efficiency Benchmark for Code Large Language Modelscited by 35
- 2024Search-Based LLMs for Code Optimizationcited by 28
- 2023Supersonic: Learning to Generate Source Code Optimizations in C/C++cited by 16
- 2024Search-Based LLMs for Code Optimization22 Aug 2024
- 2024Mercury: A Code Efficiency Benchmark for Code Large Language Models12 Feb 2024
- 2023Supersonic: Learning to Generate Source Code Optimizations in C/C++26 Sep 2023
- 2023Learning Performance-Improving Code Edits15 Feb 2023