mlsanityData to 14 Oct 2026

CodePAD: Sequence-based Code Generation with Pushdown Automaton

arXiv 2211.00818 ↗First posted 2 Nov 2022cs.SE cs.AIcited by 7

Not on the map. Why?

Abstract (arXiv)

In the process of code generation, it is essential to guarantee the generated code satisfies grammar constraints of programming language (PL). However, neglecting grammar constraints is a fatal drawback of commonly used sequence-based code generation. In this paper, we devise a pushdown automaton (PDA)-based methodology to address this problem, exploiting the principle that PL is a subset of PDA recognizable language and code accepted by PDA is grammatical. Specifically, we construct a PDA module and design an algorithm to constrain the generation of sequence-based models to ensure grammatical correctness. Guided by this methodology, we further propose CodePAD, a sequence-based code generation framework equipped with a PDA module, to integrate the deduction of PDA into deep learning. Additionally, this framework can leverage states of PDA deduction (including state representation, state prediction task, and joint prediction with state) to assist models in learning PDA deduction. To comprehensively evaluate CodePAD, we construct a PDA for Python and conduct extensive experiments on four public benchmark datasets. CodePAD can leverage existing sequence-based models, and we show that it can achieve 100% grammatical correctness percentage on these benchmark datasets. Thus, it relatively improve 17% CodeBLEU on CONALA, 8% EM on DJANGO, and 15% CodeBLEU on JUICE-10K compared to base models. In addition, our method significantly enhances pre-trained models, e.g., CodeBLEU of CodeGen-350M improvement from 3.21 to 21.54 on MBPP in zero-shot setting.

Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 29 of its 40 references that are in the map. First posted on arXiv 2 Nov 2022.

Builds on

29 of 40 references.

References · 29

  1. 2017Attention Is All You Needcited by 60,361
  2. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  3. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,893
  4. 2021Program Synthesis with Large Language Modelscited by 3,637
  5. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  6. 2015Pointer Networkscited by 895
  7. 2013Generating Sequences With Recurrent Neural Networkscited by 554
  8. 2017Convolutional Sequence to Sequence Learningcited by 552
  9. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
  10. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
  11. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
  12. 2021Unified Pre-training for Program Understanding and Generationcited by 366
17 more
  1. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  2. 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
  3. 2016Language to Logical Form with Neural Attentioncited by 158
  4. 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
  5. 2016Data Recombination for Neural Semantic Parsingcited by 111
  6. 2017Abstract Syntax Networks for Code Generation and Semantic Parsingcited by 92
  7. 2018TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generationcited by 88
  8. 2016Latent Predictor Networks for Code Generationcited by 73
  9. 2019Code Generation as a Dual Task of Code Summarizationcited by 62
  10. 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
  11. 2019JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code Generationcited by 49
  12. 2022Compilable Neural Code Generation with Compiler Feedbackcited by 47
  13. 2018A Grammar-Based Structural CNN Decoder for Code Generationcited by 29
  14. 2019Semantic Parsing with Dual Learningcited by 28
  15. 2022Incorporating Domain Knowledge through Task Augmentation for Front-End JavaScript Code Generationcited by 11
  16. 2021Improving Tree-Structured Decoder Training for Code Generation via Mutual Learningcited by 10
  17. 2021Exploring Dynamic Selection of Branch Expansion Orders for Code Generationcited by 10

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 2; 2025: 4; 2026: 1.

7 papers.