The Hidden Environmental Cost of Poor Coding Practices in TensorFlow and Keras Applications: A Study on Resource Leaks and Carbon Emissions
- company Hugging Face
- lab arXivLabs
- location California
- product DagsHub
- product Gotit.pub
- product Keras
- product ScienceCast
- product TensorFlow
Poor coding practices in TensorFlow and Keras applications can sharply increase energy consumption and carbon emissions, according to a new study that quantifies the environmental toll of common resource leaks in machine learning code [1]. The study, posted to arXiv on June 18, 2026, examined two resource-leak smells: Improper Model Reuse (IMR) and Unreleased Tensor References (UTR). Controlled experiments showed IMR increased electricity consumption by approximately 32% and UTR by approximately 46%, with proportional rises in CO2 emissions [1][2]. Paired statistical tests indicated the differences were systematic and statistically significant [2]. Resource leaks in ML code can introduce hidden inefficiencies that elevate energy consumption and CO2 emissions, yet empirical evidence quantifying their environmental impact has been limited [2]. The authors wrote that the findings provide initial empirical evidence that resource-leak smells may degrade ML energy efficiency and environmental sustainability [2]. The paper recommends integrating resource-lifecycle management and energy-efficiency considerations into ML development [1][2]. The findings arrive as the computational demands of large language models draw increased scrutiny. DeepSeek, a Chinese AI company, reported training its V3 model for US$6 million, using approximately one-tenth the computing power consumed by Meta's comparable Llama 3.1 model [6]. Large language models are trained with self-supervised learning on vast amounts of text and contain many parameters [7]. The arXiv paper is accessible through the platform's Labs framework, which allows collaborators to develop and share new features directly on the site [1]. Hugging Face has collaborated with arXiv to embed interactive demos alongside papers, enabling users to try state-of-the-art research without writing code [3][4][5]. The integration, launched in 2022, has made over 12,000 open-source machine learning demos available through Hugging Face Spaces [3]. Researchers and community members can link demos to arXiv papers by including a paper citation in a Space's README file or by associating a model on the Hugging Face Hub with a Space [5]. The demo tab appears on arXiv abstract pages for papers in computer science, statistics, and electrical engineering and systems science categories [4].
applicationresearch-paper
Background sources we checked (7)
- arxiv.org ↗ Efficiency and sustainability are critical considerations in the development and deployment of machine learning (ML) applications. Among the factors influencing sustainability, resource leaks in ML code can introduce hidden inefficiencies that elevate energy consumption and CO2 e…
- huggingface.co ↗ Hugging Face Machine Learning Demos on arXiv Back to Articles ... # Hugging Face Machine Learning Demos on arXiv Published November 17, 2022 Update on GitHub Upvote 1 - - - - - Abubakar Abid abidlabs Follow …
- info.arxiv.org ↗ ## Hugging Face Spaces ... Hugging Face code repositories, About Hugging Face ... Collaborators: Abubakar Abid, Omar Sanseviero, Ahsen Khaliq, and the Hugging Face team ... Hugging Face Spaces includes links to demos created by the community or the authors themselves. By going to…
- huggingface.co ↗ Demos on Hugging Face Spaces allow a wide audience to try out state-of-the-art machine learning research without writing any code. Hugging Face and ArXiv have collaborated to embed these demos directly along side papers on ArXiv! ... Thanks to this integration, users can now find…
- en.wikipedia.org ↗ Hangzhou DeepSeek Artificial Intelligence Basic Technology Research Co., Ltd., doing business as DeepSeek, is a Chinese artificial intelligence (AI) company that develops large language models (LLMs). Based in Hangzhou, Zhejiang, DeepSeek is owned and funded by High-Flyer, a Chin…
- en.wikipedia.org ↗ A large language model (LLM) is a type of machine learning model designed for natural language processing tasks such as language generation. LLMs are language models with many parameters, and are trained with self-supervised learning on a vast amount of text.…
- en.wikipedia.org ↗ Douwe Kiela is a Dutch-American research scientist and entrepreneur working in the field of artificial intelligence with a focus on machine learning and natural language processing. He is a research scientist director at Google DeepMind. He previously co-founded and served as CEO…