category: literaturenote citekey: bhattharmoneselfadaptiveapproach2025 title: "HarmonE: A Self-Adaptive Approach to Architecting Sustainable MLOps" authors: "Bhatt, Hiya; Biswas, Shaunak; Rakhunathan, Srinivasan; Vaidhyanathan, Karthik" year: 2025 date: 2025-00-00 2025 url: "https://arxiv.org/abs/2505.13693v1" zotero_key: AGFUWECA zotero_storage: AVM96MJJ collections: transpordi_planeerimine folder: 001_artiklid firstAuthor: "Bhatt, Hiya"
Hiya Bhatt1⋆ , Shaunak Biswas1⋆ , Srinivasan Rakhunathan2 , and Karthik Vaidhyanathan1
1 Software Engineering Research Centre, IIIT Hyderabad, India {hiya.bhatt,shaunak.biswas}@research.iiit.ac.in karthik.vaidhyanathan@iiit.ac.in 2 Microsoft, India srrakhun@microsoft.com
Abstract. Machine Learning Enabled Systems (MLS) are becoming integral to real-world applications, but ensuring their sustainable performance over time remains a significant challenge. These systems operate in dynamic environments and face runtime uncertainties like data drift and model degradation, which affect the sustainability of MLS across multiple dimensions: technical, economical, environmental, and social. While Machine Learning Operations (MLOps) addresses the technical dimension by streamlining the ML model lifecycle, it overlooks other dimensions. Furthermore, some traditional practices, such as frequent retraining, incur substantial energy and computational overhead, thus amplifying sustainability concerns. To address them, we introduce HarmonE, an architectural approach that enables self-adaptive capabilities in MLOps pipelines using the MAPE-K loop. HarmonE allows system architects to define explicit sustainability goals and adaptation thresholds at design time, and performs runtime monitoring of key metrics, such as prediction accuracy, energy consumption, and data distribution shifts, to trigger appropriate adaptation strategies. We validate our approach using a Digital Twin (DT) of an Intelligent Transportation System (ITS), focusing on traffic flow prediction as our primary use case. The DT employs time series ML models to simulate real-time traffic and assess various flow scenarios. Our results show that HarmonE adapts effectively to evolving conditions while maintaining accuracy and meeting sustainability goals.
Keywords: Self-Adaptation · MLOps · Sustainability · Green AI
Machine Learning Enabled Systems (MLS) are increasingly being deployed in realworld settings such as intelligent transportation [4], healthcare [20], and industrial automation [19]. As these systems become integral to everyday applications, ensuring their sustainability has emerged as a critical challenge. Sustainability is recognized as a multi-dimensional quality attribute [2], encompassing technical (e.g., model accuracy and maintainability), environmental (e.g., energy consumption and emissions), economic (e.g., cost-efficiency and resource usage), and social (e.g., user trust
⋆ Equal contribution.
and long-term impact) dimensions [16]. However, current ML practices often neglect sustainability, given that ML models have evolved to become more computationally intensive over time. In response, the Green AI movement emphasizes resource efficiency and environmental responsibility in AI research and practice [21]. Despite these efforts, recent surveys indicate that approximately half of ML models fail to transition from prototype to production [7], possibly due to sustainability issues like operational complexity, high resource demands, and long-term maintainability challenges [23]. This highlights the importance of explicitly incorporating sustainability into ML deployment practices. Machine Learning Operations (MLOps), which automates the lifecycle of an ML model, has improved technical robustness of MLS but often overlooks environmental and economic impacts. For instance, retraining large models like BERT can consume over 1,500 kWh, emit more than 700 lbs of CO2, and cost upwards of \$12,000, highlighting the significant sustainability trade-offs involved [24]. Recent literature has considered self-adaptation as a strategy to improve sustainability across all dimensions of MLOps pipelines [3]. By enabling systems to autonomously monitor their internal state and external environment, self-adaptive mechanisms can respond to runtime uncertainties such as data drift, performance degradation, or energy overuse. However, existing approaches typically rely on instantaneous reactions, leading to aggressive adaptations that can increase operational overhead [13] [27].
Fig. 1. Adaptation explained as a sustainability goal
To overcome these limitations, we propose HarmonE, an architectural approach that integrates self-adaptive capabilities into MLOps pipelines through the MAPE-K loop [12], with the goal of supporting long-term sustainability. HarmonE continuously monitors metrics such as prediction accuracy, energy consumption, and data distribution shifts, aligning adaptations with sustainability goals established at design time. Prior work has represented adaptation intent as a sustainability goal, defined by maintaining system quality within adaptation boundaries [9]. Drawing inspiration from this, we introduce a control-theoretic mechanism centered around a fixed reference level, near which the system is expected to operate over time. This enables the system to tolerate temporary deviations, both positive and negative, without triggering immediate adaptation. It allows the dynamic adaptation boundaries to evolve gradually based on the cumulative effect of deviations. As illustrated in Figure 1, adaptation is only triggered when deviations approach these evolving boundaries, allowing for more deliberate, context-aware responses that ensure the sustainability of the system over time. We demonstrate HarmonE's effectiveness using a traffic flow prediction scenario within a Digital Twin (DT) of an Intelligent Transportation System (ITS). This realistic environment evaluates how HarmonE maintains predictive performance and achieves sustainability goals under dynamic real-world conditions. Our results indicate that HarmonE effectively balances short-term performance and long-term sustainability objectives across multiple dimensions.
As part of an ongoing collaborative effort between IIIT Hyderabad, India and Middlesex University, London under the DigIT project, a DT is being developed for ITS. The DT is intended to support a wide range of urban mobility functionalities, including real-time simulation, monitoring, and control of traffic infrastructure. One of the key system requirements, identified by stakeholders, is the ability to predict the flow of traffic. These predictions will drive downstream tasks such as adaptive traffic re-routing and congestion management within the DT environment. To fulfill this requirement, the system employs an ML-enabled prediction layer integrated into an MLOps pipeline in the DT architecture. The pipeline automates data ingestion from road sensors, preprocessing, model training and validation, deployment, and continuous performance monitoring. Due to the dynamic and non-stationary nature of traffic patterns, which is affected by factors such as time-of-day, accidents, and seasonal variations, the prediction models must be frequently updated to retain accuracy over time. However, this retraining process is computationally intensive, leading to increased energy consumption and associated operational costs. In the early development phase, the Performance Measurement System (PeMS) dataset from California's highway sensor network was used to benchmark the prediction performance of several ML models under varying conditions. During this evaluation, the high energy cost and computational overhead of frequent retraining raised concerns about the long-term environmental and economic sustainability of the DT's predictive capabilities. To address this challenge, we develop HarmonE, a self-adaptive framework designed to balance model accuracy with energy efficiency. The PeMS dataset, which includes high-frequency readings from over 40,000 sensors, provides real-world traffic data. For this use case, we use a single sensor node and extract traffic flow aggregated at 5-minute intervals. Predictive models are trained on this data to support traffic forecasting within the DT. This setting enables us to examine how adaptation strategies can contribute to the long-term sustainability of the DT's predictive layer under real-world variability. We refer to this use case throughout the paper to contextualize HarmonE.
HarmonE is an architectural approach that integrates self-adaptive capabilities into MLOps pipelines to manage runtime uncertainties while aligning with sustainability goals using MAPE-K loop [12]. The overall architecture of HarmonE is illustrated in Figure 3, which outlines the interaction between its three main components: (1) the Managed System, representing the MLS under adaptation; (2) the Managing System, which monitors the MLS and its environment, detects uncertainties, and plans and executes adaptations; and (3) the Decision Map, which captures sustainability concerns at design time to guide runtime adaptation.
The Managed System encompasses the operational elements of the MLOps pipeline and consists of two key components:
Fig. 2. A decision map for a traffic flow prediction pipeline
A Decision Map (DM), as shown in Figure 2, is a visual representation of sustainability concerns across the Social, Environmental, Technical and Economic dimensions [16]. At design time, the system architect defines key system functionalities, identifies their associated sustainability concerns, and captures their relationships in the DM. Adaptation boundaries are then set based on sustainability goals to guide runtime decisions. Figure 2 shows the DM for our DT use case, which is designed for ITS as explained in Section 2. Although the DT encompasses multiple functionalities, such as simulation and monitoring of traffic conditions, this DM specifically addresses sustainability concerns related to the traffic flow prediction component. For the predictive component of the DT to remain sustainable, it needs to continuously meet its sustainability goals: (a) Reducing energy consumption; (b) Improving prediction accuracy and model performance; (c) Minimizing operational costs; (d) Enhancing overall system performance; (e) Ensuring system maintainability. To achieve these goals, the DM identifies three functionalities: model retraining, data and model versioning, and model switching. Each functionality affects distinct sustainability dimensions, guiding runtime adaptations through explicit boundaries stored in the Knowledge Base of the MAPE-K loop.
Model Retraining happens whenever changes in traffic patterns due to events like road closures or festivals are identified. Retraining models ideally improves predictive accuracy, positively impacting system performance, but also negatively influences environmental and economic sustainability by increasing energy consumption and operational costs (see Figure 2). An example of an adaptation boundary here is setting a threshold for allowable data distribution drift (e.g., maximum acceptable KL divergence [15]) before retraining is triggered. These boundaries ensure retraining is performed only when necessary, balancing model accuracy against resource utilization. Data and Model Versioning involves storing trained models along with their corresponding training datasets. This functionality positively affects system maintainability by allowing the reuse of existing models whenever similar traffic conditions reoccur, such as regular rush hours or predictable seasonal variations. However, it negatively impacts operational costs due to additional storage requirements. Hence, an adaptation boundary defined here could be the maximum allowable storage capacity, ensuring the versioning process remains sustainable without excessive overhead. Lastly, Model Switching allows dynamic selection among pre-trained models based on runtime observations, guided by adaptation boundaries set for metrics like energy consumption and inference accuracy. For instance, in the DT for ITS scenario (refer Section 2), if a highly accurate model surpasses an energy consumption threshold defined in the DM, the system switches to a more energy-efficient model to preserve environmental sustainability.
The Managing System is responsible for monitoring the Managed System and its environment, detecting uncertainties at runtime, planning, and executing adaptations. It is composed of several components:
Fig. 3. HarmonE Architecture
$$S_i = \beta A_i + (1 - \beta)(1 - \bar{E}_i),$$ (1)
trigger retraining + send data where Ai is the accuracy metric (e.g., R2 score), E¯ i is normalized energy, and β∈[0,1] is a design-time weight balancing accuracy and efficiency. To smooth short-term fluctuations, an Exponential Moving Average (EMA) of Si is maintained:
$$EMA(S_i) = \gamma Si + (1 - \gamma)EMA(S{i-1}), \qquad (2)$$
where γ is a smoothing factor that determines the sensitivity to recent performance. To monitor distributional shifts in the data, a suitable divergence measure is used based on the task domain. For instance, in regression settings, KL Divergence D is computed between the data distribution of recently observed true values Pt and a reference distribution Pr, as demonstrated in [18]. All metrics computed by the Metric Monitor are passed to Analyzer as inputs to guide adaptation decisions. For instance, in the DT use case described in Section 2, these metrics are derived from real-time traffic data captured by a sensor node within California's highway network.
triggers Planner to select an appropriate adaptation strategy. For energy efficiency, if the normalized energy consumption E¯ i at any interval i exceeds a dynamic energy threshold τEi , Analyzer flags this as an uncertainty and calls Planner which triggers adaptation. Inspired by control theory principles [8], we use the following update rule for τEi to adapt to persistent energy deviations:
$$\tau{E{i+1}} = \tau_{Ei} + \delta \cdot (\bar{E}{ref} - \bar{E}_i), \tag{3}$$
where E¯ ref is a design-time reference energy level and δ∈(0,1) is a decay factor, both defined in the DM by the system architect. When E¯ i >E¯ ref, the negative deviation (E¯ ref−E¯ i) reduces τEi to a lower τEi+1 , tightening the adaptation boundaries to enforce stricter energy constraints. Conversely, if E¯ i i to τEi+1 , loosening the adaptation boundaries to accommodate transient energy spikes while maintaining efficiency. For drift-based adaptation, Analyzer evaluates the distribution shift metric D, computed by Monitor, against a predefined threshold τdrift specified by the system architect. If D> τdrift, an uncertainty is detected, and Planner is invoked to mitigate this drift-related violation. For example, in the DT use case, a sudden change in traffic patterns may increase D beyond the acceptable limit, prompting Analyzer to initiate appropriate drift-handling adaptations.
Table 1. Self-Adaptation Uncertainties, Tactics, and Strategies for Sustainable MLOps
| Uncertainty Concern | Impact | Tactics | Strategy | |||
|---|---|---|---|---|---|---|
| Immediate Enabling | Systemic | |||||
| 1. | Technical | Reduced | Reduced | Reduced | 1. Model | a. Switch to |
| Model Drift | prediction | user trust | social | switch | better-fit model | |
| quality | benefits | from VMR | ||||
| 2. Retrain | b. | |||||
| Retrain via Incre | ||||||
| mental/Transfer | ||||||
| Learning/Full | ||||||
| retraining | ||||||
| 2. | Technical | Degraded | Inaccurate | Trust | 1. Model | a. Switch to |
| Data Drift | due to | predictions | loss, low | switch | better-fit model | |
| data shifts | relevance | from VMR | ||||
| 2. Retrain | b. Retrain | |||||
| with resam | ||||||
| pled/augmented | ||||||
| data | ||||||
| 3. High | Environmental Increased | Environmental | Lower | 1. | a. Switch | |
| Energy Con | costs | impact | compet | Model switch | to lighter model | |
| sumption | itiveness | 2. Model | b. Quantize | |||
| Compression | current model | |||||
| 4. | Technical | Decline in | Increased need | Reduced | 1. Model | a. Switch |
| Model per | predictive | for frequent | maintain | switch | to a model with | |
| formance | accuracy | retraining | ability | higher accuracy | ||
| degra | 2. Retrain | b. Retrain | ||||
| dation | the model |
We assess the efficiency of HarmonE by answering these Research Questions (RQ): RQ1: How does HarmonE ensure the long-term environmental sustainability of MLS?
RQ2: How does HarmonE manage the trade-off between energy consumption and predictive accuracy compared to baseline approaches?
RQ3: How efficient are the adaptation decisions made by HarmonE in terms of their frequency and resource usage?
The remainder of this section describes the setup and design of the experiments to evaluate our system.
To evaluate HarmonE, we design an experimental setup that reflects the challenges and operational dynamics of sustainability-aware inference in real-world systems. As described in the use case (Section 2), we utilize traffic flow (Vehicles/5 Minutes) data collected from sensor nodes deployed as part of the California PeMS platform. For forecasting, we structure the data in a supervised learning format where each model receives the previous 5 timesteps (i.e., 25 minutes of sensor readings) as input to predict the traffic flow for the 6th timestep (i.e., the 30th minute). This setup allows us to evaluate the models' ability to learn short-term temporal dependencies while operating under energy and latency constraints. Further, we construct a spectrum of models that vary in both predictive accuracy and computational cost:
We conducted a pilot experiment over a short interval and observed that while LSTM generally provides higher accuracy, LR and SVM models often yield satisfactory performance at significantly lower energy cost. This supports their inclusion in the inference setup to enable more energy-efficient predictions when appropriate. All models are trained on a fixed-size historical dataset to ensure uniform comparison. After training, they are deployed in the Inference Subsystem for real-time inference on incoming sensor data. During inference, the system logs key metrics such as prediction output, ground truth, inference time, and energy consumption. The coefficient of determination R2 is used to evaluate predictive accuracy. Energy consumption is measured using the pyRAPL3 library, which provides high-resolution energy profiling at the system level. The models were implemented using the Python libraries scikit-learn for Linear Regression and SVM, and PyTorch for LSTM. For details of the implementation, please refer to our Github repository 4
To systematically evaluate the sustainability and effectiveness of HarmonE, we compare it against the following baselines:
We divide the dataset into three parts: 80% (1200 samples) is used for training, 20% (240 samples) for validation, and a separate test set of 14,500 samples is used for inference and evaluation. All models are trained using the same training-validation split to ensure consistency across approaches. Retraining, whether periodic or triggered (HarmonE), is performed using 1200 samples, consistent with the original training
3 https://pypi.org/project/pyRAPL/ (last accessed May 20, 2025)
4 https://github.com/sa4s-serc/HarmonE (last accessed May 20, 2025)
window size, with periodic retraining triggered uniformly every 3200 timesteps. To ensure consistent and reliable results, each baseline experiment is repeated independently five times, following established guidelines for empirical software engineering [29]. Additionally, a cooldown period of 20 minutes is introduced between consecutive runs to stabilize hardware conditions and ensure accurate energy profiling. All experiments are conducted in a controlled simulation environment, enabling reproducibility and fair comparisons. The performance of these approaches is summarized in Table 2.
To evaluate HarmonE's performance in the presence of real-world uncertainties, we simulate distribution drift in the test dataset. This is done to mimic scenarios where external factors, such as traffic rerouting due to roadblocks or unexpected events like accidents, cause abrupt changes in data patterns. Specifically, we induce controlled data drift by applying a consistent scale-and-shift transformation twice to designated segments of the test data. Our drift induction method, inspired by [18], ensures the changes are measurable and representative of natural concept drift, thereby enabling meaningful evaluation of HarmonE 's adaptation capabilities. By repeating the same transformation, we simulate a scenario where the data distribution first diverges and later realigns with a previously seen pattern. This enables HarmonE to demonstrate both drift detection and effective model reuse by identifying similarity with historical distributions stored in the VMR.
All experiments were conducted on a system with the following specifications: Debian GNU/Linux 12 (Bookworm) operating system with kernel version 6.1.0-32-amd64, running on a 12th Gen Intel i5-1240P processor at 4.40 GHz. The system had 8 GB RAM, an integrated Intel Alder Lake-P GPU, and utilized the GNOME 43.9 desktop environment. The consistent hardware configuration ensured fair comparisons and reproducible energy profiling across all experiments.
Fig. 4. Adaptation strategies activated by HarmonE during execution.
This section presents the experimental results of our proposed approach, HarmonE, in comparison to eight baseline approaches. Figure 4 illustrates the adaptation
strategies triggered by HarmonE throughout execution. The temporal distribution of switching (S), retraining (R), and version repository access (V) events reflects how HarmonE responds to evolving conditions while balancing adaptation costs. To ensure reliability, we conducted five independent runs for each approach and averaged the energy consumption. As shown in Figure 5, results are consistent across runs, with minor variation in Switch+PRT due to stochastic model selection during retraining. Despite this, the relative performance trends remain stable, supporting the reproducibility of our findings.
Fig. 5. Average energy consumption (mJ) across five runs for all nine approaches.
HarmonE ensures long-term sustainability by maintaining energy consumption below threshold constraints. It consumes 54.5% lesser energy as compared to high-performing LSTM+PRT.
Fig. 6. Cumulative energy consumption over time for different approaches.
To analyze environmental sustainability, we examine cumulative energy consumption over time steps (Figure 6) for all approaches. HarmonE consistently maintains its energy consumption below the reference energy level (red dotted line) defined by the system architect at design time using the DM (refer 3.2), by dynamically adapting whenever this boundary is violated. Comparatively, approaches like LR, LR+PRT, SVM, and SVM+PRT show consistently low energy use but significantly underperform in predictive accuracy (discussed further in the section). In contrast, approaches like LSTM, LSTM+PRT significantly surpass HarmonE 's energy consumption. Approaches like Switch, Switch+PRT perform better than single models but still exhibit higher energy consumption than HarmonE. It is observed that all the approaches with PRT, retrain models after fixed intervals regardless of necessity thus consuming more energy, whereas HarmonE only retrains the models whenever drift is detected (refer Section 3) thus significantly reducing the energy consumption. Quantitatively, HarmonE consumes 20.62 mJ, representing a 54.5% reduction compared to LSTM+PRT (45.35 mJ) and an 18.6% reduction compared to Switching+PRT (25.32 mJ).
RQ2: How does HarmonE manage the trade-off between energy consumption and predictive accuracy compared to baseline approaches?
HarmonE effectively manages the trade-off between energy consumption and predictive accuracy. It achieves 95.0% of LSTM+PRT's accuracy while consuming only 45.5% of its energy and improves inference time by 53.4%.
Fig. 7. Energy vs. prediction error (MSE) across approaches—lower is better on both axes (on left). Inference time comparison excluding retraining—lower is better (on right).
To address RQ2, we analyze how different approaches balance predictive accuracy, energy consumption, and inference speed using the results summarized in Figure 7 and Table 2. LR and SVM-based approaches achieve minimal energy consumption (12.1157–16.3304 mJ, Table 2), but exhibit significantly higher prediction errors (1315- 1723 MSE), Figure 7) and lower predictive accuracy (R2 scores ranging from 0.7597 to 0.8167). Conversely, LSTM-based approaches deliver lower prediction errors (657–713 MSE) and higher predictive accuracy (R2 = 0.9005 and 0.9085) at the expense of substantial energy consumption (32.9147–45.3517 mJ) and inference latency (3.8475 ms). Periodic retraining, irrespective of necessity, further escalates these energy and latency costs. The Switch approach, despite aiming for balance, defaults to the heavier LSTM model without retraining smaller models when drift occurs, resulting in higher
average energy usage (24.3218 mJ) without achieving LSTM-level accuracy (R2 = 0.8445). In contrast, HarmonE dynamically manages model selection, selective retraining, and versioned model reuse, achieving an R2 score of 0.8627—95.0% of LSTM+PRT accuracy—at only 45.5% of its energy cost. Additionally, HarmonE attains faster inference times (1.89 ms), reducing latency by 53.4% compared to LSTM+PRT (4.05 ms). These results highlight HarmonE's ability to efficiently balance energy and accuracy, significantly outperforming baseline approaches.
| Approach | Energy(mJ) | R2 | Inference Time(ms) # Adaptations | |
|---|---|---|---|---|
| LR | 12.1157 | 0.7597 | 0.8306 | - |
| LR + PRT | 12.6987 | 0.7624 | 4 | |
| SVM | 14.7649 | 0.7897 | 1.1134 | - |
| SVM + PRT | 16.3304 | 0.8167 | 4 | |
| LSTM | 32.9147 | 0.9005 | 3.8475 | - |
| LSTM + PRT | 45.3517 | 0.9085 | 4 | |
| Switch | 24.3218 | 0.8445 | 2.2656 | 13 |
| Switch + PRT | 25.3176 | 0.8435 | 17 | |
| HarmonE | 20.6203 | 0.8628 | 1.8887 | 12 |
Table 2. Performance comparison of different approaches.
RQ3: How efficient are the adaptation decisions made by HarmonE in terms of their frequency and resource usage?
HarmonE makes highly efficient adaptation decisions, with the decision-making process itself consuming only 1.3660% of total system energy while enabling strategic resource optimization through context-aware adaptation mechanisms.
To address RQ3, we analyze the frequency of adaptation decisions and their resource consumption. Our experiments reveal that HarmonE's adaptation decisions are highly efficient in terms of both frequency and resource usage. The adaptation logic (MAPE-K loop) executes swiftly, averaging 17.899 ms per invocation, thereby imposing negligible runtime overhead. The energy consumed by the MAPE-K loop accounts for only 1.3660% of the total energy usage of the system. This extremely low overhead demonstrates that HarmonE's decision-making mechanism itself is highly energy-efficient. Periodic retraining approaches (LR+PRT, SVM+PRT, LSTM+PRT, Switch+PRT) conduct retraining at fixed intervals (4 per run), regardless of necessity, leading to redundant resource usage. In contrast, purely switching-based adaptation (Switch) triggers frequent model switches (average of 13 per run) without retraining, often defaulting to heavier models due to degraded performance in lighter models. HarmonE addresses these inefficiencies by selectively performing adaptations, either switching, retraining, or reusing versioned models, only when required by system conditions (as shown in Figure 4). This significantly reduces unnecessary resource consumption while maintaining predictive performance.
A threat to internal validity arises from the consistency of results across repeated experimental runs, as energy consumption and performance metrics can be affected
by background processes and runtime fluctuations. To mitigate this, all experiments were repeated independently five times for each approach, and average results were reported to ensure consistency. Additionally, a cooldown period of 20 minutes was enforced between consecutive runs to allow system conditions, particularly energy usage and temperature, to stabilize before the next experiment. A threat to Construct Validity could be that the energy measurements in our experiments were collected using the pyRAPL library, Python package specifically designed for assessing the energy consumption and power usage of software applications running on Intel processors. While the absolute energy values may differ when using alternative measurement tools or hardware platforms, we believe that the relative patterns and trends in adaptation behaviour would remain consistent. A threat to external validity concerns the generalizability of our findings beyond the specific use case of traffic flow prediction. Although this represents a realistic and dynamic application, it may not fully reflect the characteristics of other domains such as computer vision or natural language processing. Additionally, our evaluation focuses on a single task type and a limited set of models. To mitigate this, we employed a spectrum of models with varying complexity and resource requirements to simulate diverse operational conditions. While further validation is needed in other domains, HarmonE is designed to be domain-agnostic and can be extended to different MLS through appropriate domain knowledge.
There has been substantial progress in developing MLOps frameworks to automate the ML model lifecycle, as seen in works such as [1,22,25], but these primarily emphasize maintainability, scalability, and reliability, without addressing sustainability as an architectural concern. Notable efforts have been made to employ self-adaptation in MLS, such as [14], which proposes dynamic model switching strategies using MAPE-K loops to balance Quality of Service (QoS) metrics at runtime, yet remain limited to inference and do not incorporate energy, retraining cost, or long-term sustainability trade-offs. EcoMLS [27] introduces energy-aware switching during inference, marking a shift toward integrating sustainability at runtime, but it is too restricted in scope and does not address sustainability across the full ML lifecycle, including training and continuous evolution. Work in software sustainability, including [9,16], advocates architectural DM and the expression of adaptation intent as sustainability goals, but lacks integration with runtime MLOps adaptation to handle uncertainties typical in MLS. In parallel, the "Green AI" community focuses on efficient model architectures [5,10], offering energy savings at the algorithmic level, but these methods are typically static and disconnected from lifecycle or runtime MLOps concerns. Work such as [26] articulates the organizational and architectural challenges in achieving sustainable MLOps, while others like [17] explore architectural tactics to support evolvability in ML pipelines, though without mechanisms to operationalize these decisions adaptively. [6] highlights the absence of integrated, end-to-end architectural support for environmental sustainability in ML system engineering through a systematic mapping study. While these efforts lay essential groundwork, a lack of approaches that operationalize sustainability across the ML lifecycle by adaptively managing runtime uncertainties and evolving trade-offs remains. To address this, we present HarmonE, an architectural approach that enables self-adaptive capabilities in
MLOps pipelines via the MAPE-K loop. HarmonE dynamically balances predictive performance and energy consumption throughout the ML lifecycle.
This paper presented HarmonE, a self-adaptive architectural approach that integrates the MAPE-K loop within MLOps pipelines to address long-term sustainability challenges in MLS deployments. HarmonE dynamically adjusts system configurations through strategies such as model switching, selective retraining, and versioned model reuse, rather than relying on fixed-interval retraining. These design choices allow the system to continuously balance energy consumption and predictive accuracy. Experimental results obtained using a DT of an ITS demonstrate that HarmonE maintains environmental sustainability over extended periods. Specifically, HarmonE reduces energy consumption by 54.5% compared to LSTM+PRT while preserving 95% of its predictive accuracy. The approach outperforms periodic retraining methods by triggering adaptations only when sustainability boundaries are reached, thereby reducing unnecessary resource expenditure and mitigating long-term operational overhead. Future work will focus on validating HarmonE in more diverse and complex real-world environments, including domains such as computer vision and natural language processing. In particular, we aim to evaluate its applicability in LLM/SLM-enabled systems where the sustainability trade-offs of model selection, fine-tuning, and inference are more pronounced, further extending its relevance to a broader class of MLS deployments.
The traffic flow data used in this study is publicly accessible via the California Performance Measurement System (PeMS) website at https://pems.dot.ca.gov. For reproducibility and verifiability, the source code and configurations for implementing HarmonE are available at https://github.com/sa4s-serc/HarmonE.
The authors would like to thank the ANRF Prime Minister Early Career Research Grant (ANRF/ECRG/2024/003379/ENS) and the UKIERI-SPARC project titled "DigIT—Digital Twins for Integrated Transportation Platform" (UKIERI-SPARC/01/23) for their support.
1. Amershi, S., Begel, A., Bird, C., DeLine, R., Gall, H., Kamar, E., Nagappan, N., Nushi, B., Zimmermann, T.: Software engineering for machine learning: A case study. In: 2019 IEEE/ACM 41st International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP) (2019)
21. Schwartz, R., Dodge, J., Smith, N.A., Etzioni, O.: Green ai. Communications of the ACM 63(12) (2020)
22. Shankar, S., Garcia, R., Hellerstein, J.M., Parameswaran, A.G.: Operationalizing machine learning. University of California, Berkeley
23. Shivashankar, K., Martini, A.: Maintainability challenges in ml: A systematic literature review. In: 2022 48th Euromicro Conference on Software Engineering and Advanced Applications (SEAA) (2022)
24. Strubell, E., Ganesh, A., McCallum, A.: Energy and policy considerations for modern deep learning research. Proceedings of the AAAI Conference on Artificial Intelligence (09)
25. Symeonidis, G., Nerantzis, E., Kazakis, A., Papakostas, G.A.: Mlops - definitions, tools and challenges. In: 2022 IEEE 12th Annual Computing and Communication Workshop and Conference (CCWC) (2022)
26. Tamburri, D.A.: Sustainable mlops: Trends and challenges. In: 2020 22nd International Symposium on Symbolic and Numeric Algorithms for Scientific Computing (SYNASC)
27. Tedla, M., Kulkarni, S., Vaidhyanathan, K.: Ecomls: A self-adaptation approach for architecting green ml-enabled systems. arXiv preprint arXiv:2404.11411 (2024)
28. Verdecchia, R., Cruz, L., Sallou, J., Lin, M., Wickenden, J., Hotellier, E.: Data-centric green ai an exploratory empirical study. In: 2022 International Conference on ICT for Sustainability (ICT4S) (2022)
29. Wohlin, C., Runeson, P., Höst, M., Ohlsson, M., Regnell, B., Wesslén, A.: Experimentation in software engineering. Springer Science & Business Media (2012)