mlsanityData to 7 Oct 2026

Energy-Based Models for Code Generation under Compilability Constraints

arXiv 2106.04985 ↗First posted 9 Jun 2021cs.LG cs.CL cs.NEcited by 10

Not on the map. Why?

Abstract (arXiv)

Neural language models can be successfully trained on source code, leading to applications such as code completion. However, their versatile autoregressive self-supervision objective overlooks important global sequence-level features that are present in the data such as syntactic correctness or compilability. In this work, we pose the problem of learning to generate compilable code as constraint satisfaction. We define an Energy-Based Model (EBM) representing a pre-trained generative model with an imposed constraint of generating only compilable sequences. We then use the KL-Adaptive Distributional Policy Gradient algorithm (Khalifa et al., 2021) to train a generative model approximating the EBM. We conduct experiments showing that our proposed approach is able to improve compilability rates without sacrificing diversity and complexity of the generated samples.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 31 of its 49 references that are in the map. First posted on arXiv 9 Jun 2021.

Builds on

31 of 49 references.

References · 31

  1. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  2. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  3. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  4. 2019Fine-Tuning Language Models from Human Preferencescited by 2,124
  5. 2015A Diversity-Promoting Objective Function for Neural Conversation Modelscited by 1,068
  6. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  7. 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 679
  8. 2015Sequence Level Training with Recurrent Neural Networkscited by 568
  9. 2018Texygen: A Benchmarking Platform for Text Generation Modelscited by 484
  10. 2017A Deep Reinforced Model for Abstractive Summarizationcited by 364
  11. 2016Deep Reinforcement Learning for Dialogue Generationcited by 286
  12. 2020Unsupervised Translation of Programming Languagescited by 262
19 more
  1. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
  2. 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 220
  3. 2019SPoC: Search-based Pseudocode to Codecited by 176
  4. 2015Visualizing and Understanding Recurrent Networkscited by 158
  5. 2016An Actor-Critic Algorithm for Sequence Predictioncited by 158
  6. 2020A Distributional Approach to Controlled Text Generationcited by 117
  7. 2020Residual Energy-Based Models for Text Generationcited by 95
  8. 2015Structured Prediction Energy Networkscited by 59
  9. 2018Controllable Neural Story Plot Generation via Reward Shapingcited by 49
  10. 2020Fast and Memory-Efficient Neural Code Completioncited by 38
  11. 2020ENGINE: Energy-Based Inference Networks for Non-Autoregressive Machine Translationcited by 34
  12. 2016Globally Normalized Transition-Based Neural Networkscited by 26
  13. 2021An Empirical Study on the Usage of BERT Models for Code Completioncited by 22
  14. 2017Reinforced Video Captioning with Entailment Rewardscited by 21
  15. 2014Structured Generative Models of Natural Source Codecited by 19
  16. 2019Distributional Reinforcement Learning for Energy-Based Sequential Modelscited by 17
  17. 2019Global Autoregressive Models for Data-Efficient Sequence Learningcited by 15
  18. 2020Residual Energy-Based Models for Textcited by 5
  19. 2020Code Completion using Neural Attention and Byte Pair Encodingcited by 2

Built on by

Cited by year

Citing papers per year: 2021: 1; 2022: 3; 2023: 4; 2024: 1; 2025: 1.

10 papers.