CGEMs: A Metric Model for Automatic Code Generation using GPT-3
Not on the map. Why?
Abstract (arXiv)
Today, AI technology is showing its strengths in almost every industry and walks of life. From text generation, text summarization, chatbots, NLP is being used widely. One such paradigm is automatic code generation. An AI could be generating anything; hence the output space is unconstrained. A self-driving car is driven for 100 million miles to validate its safety, but tests cannot be written to monitor and cover an unconstrained space. One of the solutions to validate AI-generated content is to constrain the problem and convert it from abstract to realistic, and this can be accomplished by either validating the unconstrained algorithm using theoretical proofs or by using Monte-Carlo simulation methods. In this case, we use the latter approach to test/validate a statistically significant number of samples. This hypothesis of validating the AI-generated code is the main motive of this work and to know if AI-generated code is reliable, a metric model CGEMs is proposed. This is an extremely challenging task as programs can have different logic with different naming conventions, but the metrics must capture the structure and logic of the program. This is similar to the importance grammar carries in AI-based text generation, Q&A, translations, etc. The various metrics that are garnered in this work to support the evaluation of generated code are as follows: Compilation, NL description to logic conversion, number of edits needed, some of the commonly used static-code metrics and NLP metrics. These metrics are applied to 80 codes generated using OpenAI's GPT-3. Post which a Neural network is designed for binary classification (acceptable/not acceptable quality of the generated code). The inputs to this network are the values of the features obtained from the metrics. The model achieves a classification accuracy of 76.92% and an F1 score of 55.56%. XAI is augmented for model interpretability.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 5 of its 17 references that are in the map. First posted on arXiv 23 Aug 2021.
Builds on
5 of 17 references.
References · 5
- 2016"Why Should I Trust You?": Explaining the Predictions of Any Classifiercited by 5,040
- 2018code2vec: Learning Distributed Representations of Codecited by 249
- 2020IntelliCode Compose: Code Generation Using Transformercited by 225
- 2020PyMT5: multi-mode translation of natural language and Python code with transformerscited by 80
- 2016Latent Predictor Networks for Code Generationcited by 73
Built on by
Citing papers per year: 2022: 1; 2023: 2; 2024: 3.
6 papers.
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Surveycited by 134
- 2023Generative Pre-trained Transformer: A Comprehensive Review on Enabling Technologies, Potential Applications, Emerging Challenges, and Future Directionscited by 55
- 2024Investigating Large Language Models for Code Vulnerability Detection: An Experimental Studycited by 11
- 2022a survey on GPT-3cited by 9
- 2024Automated Multi-Language to English Machine Translation Using Generative Pre-Trained Transformerscited by 0
- 2024Automated Creation of Source Code Variants of a Cryptographic Hash Function Implementation Using Generative Pre-Trained Transformer Modelscited by 0
- 2024Investigating Large Language Models for Code Vulnerability Detection: An Experimental Study24 Dec 2024
- 2024Automated Creation of Source Code Variants of a Cryptographic Hash Function Implementation Using Generative Pre-Trained Transformer Models24 Apr 2024
- 2024Automated Multi-Language to English Machine Translation Using Generative Pre-Trained Transformers23 Apr 2024
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Survey30 May 2023
- 2023Generative Pre-trained Transformer: A Comprehensive Review on Enabling Technologies, Potential Applications, Emerging Challenges, and Future Directions11 May 2023
- 2022a survey on GPT-31 Dec 2022