mlsanityData to 7 Oct 2026

GAP-Gen: Guided Automatic Python Code Generation

arXiv 2201.08810 ↗First posted 19 Jan 2022cs.PL cs.CL cs.LGcited by 2

Not on the map. Why?

Abstract (arXiv)

Automatic code generation from natural language descriptions can be highly beneficial during the process of software development. In this work, we propose GAP-Gen, a Guided Automatic Python Code Generation method based on Python syntactic constraints and semantic constraints. We first introduce Python syntactic constraints in the form of Syntax-Flow, which is a simplified version of Abstract Syntax Tree (AST) reducing the size and high complexity of Abstract Syntax Tree but maintaining crucial syntactic information of Python code. In addition to Syntax-Flow, we introduce Variable-Flow which abstracts variable and function names consistently through out the code. In our work, rather than pretraining, we focus on modifying the finetuning process which reduces computational requirements but retains high generation performance on automatic Python code generation task. GAP-Gen fine-tunes the transformer based language models T5 and CodeT5 using the Code-to-Docstring datasets CodeSearchNet, CodeSearchNet AdvTest and Code-Docstring Corpus from EdinburghNLP. Our experiments show that GAP-Gen achieves better results on automatic Python code generation task than previous works.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 35 of its 55 references that are in the map. First posted on arXiv 19 Jan 2022.

Builds on

35 of 55 references.

References · 35

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  5. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  6. 2019The Curious Case of Neural Text Degenerationcited by 2,881
  7. 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,126
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  9. 2018Hierarchical Neural Story Generationcited by 1,182
  10. 2019Attention is not Explanationcited by 916
  11. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  12. 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 770
23 more
  1. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  2. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  3. 2019Neural Text Generation with Unlikelihood Trainingcited by 489
  4. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  5. 2020Autoregressive Entity Retrievalcited by 333
  6. 2019Revealing the Dark Secrets of BERTcited by 300
  7. 2018Plan-And-Write: Towards Better Automatic Storytellingcited by 232
  8. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
  9. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  10. 2020If beam search is the answer, what was the question?cited by 114
  11. 2019Hello, It's GPT-2 -- How Can I Help You? Towards the Use of Pretrained Language Models for Task-Oriented Dialogue Systemscited by 110
  12. 2020PlotMachines: Outline-Conditioned Generation with Dynamic Plot State Trackingcited by 104
  13. 2019Optimizing the Factual Correctness of a Summary: A Study of Summarizing Radiology Reportscited by 96
  14. 2020Content Planning for Neural Story Generation with Aristotelian Rescoringcited by 92
  15. 2019Do Massively Pretrained Language Models Make Better Storytellers?cited by 90
  16. 2019On the Weaknesses of Reinforcement Learning for Neural Machine Translationcited by 82
  17. 2020PyMT5: multi-mode translation of natural language and Python code with transformerscited by 80
  18. 2016Latent Predictor Networks for Code Generationcited by 73
  19. 2020Multi-task Learning based Pre-trained Language Model for Code Completioncited by 58
  20. 2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationcited by 56
  21. 2015Program Synthesis using Natural Languagecited by 41
  22. 2021Implicit Unlikelihood Training: Improving Neural Text Generation with Reinforcement Learningcited by 16
  23. 2019Machine Translation from Natural Language to Code using Long-Short Term Memorycited by 4

Built on by

Cited by year

Citing papers per year: 2024: 1; 2025: 1.

2 papers.