Learn to Code Sustainably: An Empirical Study on LLM-based Green Code Generation
Not on the map. Why?
Abstract (arXiv)
The increasing use of information technology has led to a significant share of energy consumption and carbon emissions from data centers. These contributions are expected to rise with the growing demand for big data analytics, increasing digitization, and the development of large artificial intelligence (AI) models. The need to address the environmental impact of software development has led to increased interest in green (sustainable) coding and claims that the use of AI models can lead to energy efficiency gains. Here, we provide an empirical study on green code and an overview of green coding practices, as well as metrics used to quantify the sustainability awareness of AI models. In this framework, we evaluate the sustainability of auto-generated code. The auto-generate codes considered in this study are produced by generative commercial AI language models, GitHub Copilot, OpenAI ChatGPT-3, and Amazon CodeWhisperer. Within our methodology, in order to quantify the sustainability awareness of these AI models, we propose a definition of the code's "green capacity", based on certain sustainability metrics. We compare the performance and green capacity of human-generated code and code generated by the three AI language models in response to easy-to-hard problem statements. Our findings shed light on the current capacity of AI models to contribute to sustainable software development.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 31 of its 66 references that are in the map. First posted on arXiv 5 Mar 2024.
Builds on
31 of 66 references.
References · 31
- 2019EfficientNet: Rethinking Model Scaling for Convolutional Neural Networkscited by 6,415
- 2018MobileNetV2: Inverted Residuals and Linear Bottleneckscited by 4,773
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
- 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,413
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
- 2015Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Codingcited by 2,291
- 2015Learning both Weights and Connections for Efficient Neural Networkscited by 1,998
- 2020GShard: Scaling Giant Models with Conditional Computation and Automatic Shardingcited by 1,601
- 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,242
- 2018ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Designcited by 1,132
- 2019Green AIcited by 620
- 2021Carbon Emissions and Large Neural Network Trainingcited by 561
19 more
- 2019Quantifying the Carbon Emissions of Machine Learningcited by 516
- 2020Fine-Tuning Pretrained Language Models: Weight Initializations, Data Orders, and Early Stoppingcited by 377
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022Estimating the Carbon Footprint of BLOOM, a 176B Parameter Language Modelcited by 264
- 2020Towards the Systematic Reporting of the Energy and Carbon Footprints of Machine Learningcited by 246
- 2021Sustainable AI: Environmental Implications, Challenges and Opportunitiescited by 242
- 2019The Evolved Transformercited by 180
- 2020Funnel-Transformer: Filtering out Sequential Redundancy for Efficient Language Processingcited by 161
- 2016An Analysis of Deep Neural Network Models for Practical Applicationscited by 114
- 2022Measuring the Carbon Intensity of AI in Cloud Instancescited by 110
- 2021Jigsaw: Large Language Models meet Program Synthesiscited by 103
- 2019Write, Execute, Assess: Program Synthesis with a REPLcited by 92
- 2023Evaluating the Code Quality of AI-Assisted Code Generation Tools: An Empirical Study on GitHub Copilot, Amazon CodeWhisperer, and ChatGPTcited by 71
- 2018Constructing Fast Network through Deconstruction of Convolutioncited by 24
- 2019Gossip-based Actor-Learner Architectures for Deep Reinforcement Learningcited by 16
- 2019A Survey of Automatic Generation of Source Code Comments: Algorithms and Techniquescited by 15
- 2023The Framework Tax: Disparities Between Inference Efficiency in NLP Research and Deploymentcited by 11
- 2018Diagonalwise Refactorization: An Efficient Training Method for Depthwise Convolutionscited by 6
- 2023How is the speed of code review affected by activity, usage and code quality?cited by 1
Built on by
Citing papers per year: 2024: 2; 2025: 4; 2026: 1.
7 papers.
- 2024Sociotechnical Implications of Generative Artificial Intelligence for Information Accesscited by 6
- 2024Green My LLM: Studying the key factors affecting the energy consumption of code assistantscited by 6
- 2025Carbon Footprint Evaluation of Code Generation through LLM as a Servicecited by 4
- 2025Evaluating the Energy-Efficiency of the Code Generated by LLMscited by 3
- 2025Addressing the sustainable AI trilemma: a case study on LLM agents and RAGcited by 1
- 2025Energy-Aware Code Generation with LLMs: Benchmarking Small vs. Large Language Models for Sustainable AI Programmingcited by 1
- 2026Beyond the Need for Speed: Energy-Aware Code Generation via Simulation-Guided Reinforcement Learningcited by 0
- 2026Beyond the Need for Speed: Energy-Aware Code Generation via Simulation-Guided Reinforcement Learning6 Jul 2026
- 2025Energy-Aware Code Generation with LLMs: Benchmarking Small vs. Large Language Models for Sustainable AI Programming10 Aug 2025
- 2025Evaluating the Energy-Efficiency of the Code Generated by LLMs23 May 2025
- 2025Carbon Footprint Evaluation of Code Generation through LLM as a Service30 Mar 2025
- 2025Addressing the sustainable AI trilemma: a case study on LLM agents and RAG14 Jan 2025
- 2024Green My LLM: Studying the key factors affecting the energy consumption of code assistants7 Nov 2024
- 2024Sociotechnical Implications of Generative Artificial Intelligence for Information Access19 May 2024