Do Generative AI Tools Ensure Green Code? An Investigative Study
Samarth Sikand, Rohit Mehra, Vibhu Saujanya Sharma, Vikrant Kaulgud, Sanjay Podder, Adam P. Burden

TL;DR
This study investigates the environmental sustainability of AI-generated code from ChatGPT, BARD, and Copilot, revealing that current tools often produce non-green code and highlighting the need for improved sustainable practices.
Contribution
It provides an initial assessment of the sustainability of AI-generated code, emphasizing the default non-green behavior of popular generative AI tools.
Findings
AI tools often generate non-green code by default
Current AI tools lack sustainable coding practices
Further research is needed for eco-friendly AI code generation
Abstract
Software sustainability is emerging as a primary concern, aiming to optimize resource utilization, minimize environmental impact, and promote a greener, more resilient digital ecosystem. The sustainability or "greenness" of software is typically determined by the adoption of sustainable coding practices. With a maturing ecosystem around generative AI, many software developers now rely on these tools to generate code using natural language prompts. Despite their potential advantages, there is a significant lack of studies on the sustainability aspects of AI-generated code. Specifically, how environmentally friendly is the AI-generated code based upon its adoption of sustainable coding practices? In this paper, we present the results of an early investigation into the sustainability aspects of AI-generated code across three popular generative AI tools - ChatGPT, BARD, and Copilot. The…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
