Code once, Run Green: Automated Green Code Translation in Serverless Computing

📅 2025-09-26
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses “energy debt”—a sustainability challenge in serverless platforms arising from legacy architectural decisions—by proposing the first LLM-based cross-language green code migration paradigm. Methodologically, it leverages large language models to automatically translate energy-intensive functions into more energy-efficient languages (e.g., Rust or Go) while preserving semantic correctness, and integrates the translated code into the Fission framework via ReFaaS for end-to-end automated energy optimization. Key contributions include: (1) the first systematic investigation of LLM-driven green cross-language translation feasibility; (2) identification and formal modeling of four critical research challenges; and (3) empirical validation demonstrating up to 70% reduction in per-invocation energy consumption, with net energy savings achieved for most functions within 3,000–5,000 invocations. The results confirm the paradigm’s effectiveness and potential for sustainable serverless computing.

Technology Category

Application Category

📝 Abstract
The rapid digitization and the increasing use of emerging technologies such as AI models have significantly contributed to the emissions of computing infrastructure. Efforts to mitigate this impact typically focus on the infrastructure level such as powering data centers with renewable energy, or through the specific design of energy-efficient software. However, both strategies rely on stakeholder intervention, making their adoption in legacy and already-deployed systems unlikely. As a result, past architectural and implementation decisions continue to incur additional energy usage - a phenomenon we refer to as energy debt. Hence, in this paper, we investigate the potential of serverless computing platforms to automatically reduce energy debt by leveraging the unique access to function source code. Specifically, we explore whether large language models (LLMs) can translate serverless functions into more energy-efficient programming languages while preserving functional correctness. To this end, we design and implement ReFaaS and integrate it into the Fission serverless framework. We evaluate multiple LLMs on their ability to perform such code translations and analyze their impact on energy consumption. Our preliminary results indicate that translated functions can reduce invocation energy by up to 70%, achieving net energy savings after approximately 3,000 to 5,000 invocations, depending on the LLM used. Nonetheless, the approach faces several challenges: not all functions are suitable for translation, and for some, the amortization threshold is significantly higher or unreachable. Despite these limitations, we identify four key research challenges whose resolution could unlock long-term, automated mitigation of energy debt in serverless computing.
Problem

Research questions and friction points this paper is trying to address.

Automated translation of serverless functions to reduce energy consumption
Using large language models to convert code into energy-efficient programming languages
Addressing energy debt in legacy systems through automated green code transformation
Innovation

Methods, ideas, or system contributions that make the work stand out.

Automated translation to energy-efficient programming languages
Leveraging LLMs for serverless function code optimization
Integration into Fission framework for green computing
🔎 Similar Papers
No similar papers found.
Sebastian Werner
Sebastian Werner
Researcher, TU Berlin
Distributed SystemsCloud Native Application ArchitecturesSustainable Cloud ComputingISE@TUB
M
Mathis Kähler
Technische Universität Berlin, Germany
A
Alireza Hakamian
University of Hamburg, Germany