Harmonica: A Case Study in Self-Adaptation for Sustainable MLOps
Harmonica explores self-adaptation to manage runtime uncertainty and optimize the balance between predictive accuracy and energy consumption in MLOps.
This research proposes Harmonica, a MAPE-K loop-based self-adaptation exemplar to resolve runtime uncertainty and sustainability issues in MLOps pipelines. Results prove it enhances system stability by achieving an optimal balance between accuracy and energy consumption compared to static models.
Introduction
A critical challenge many enterprises face after deploying AI models is that benchmark performance from the lab degrades rapidly under dynamic data shifts and infrastructure constraints in production. Specifically, unconditionally utilizing complex models or frequent retraining to maintain accuracy incurs massive computing costs and energy consumption, ultimately threatening the economic and environmental sustainability of the project.
Harmonica, analyzed in this report, presents a self-adaptive architecture where the system diagnoses its own state and selects the optimal model or tactic to resolve these issues. This attempt to expand MLOps beyond simple deployment automation into an intelligent governance framework that optimizes the tradeoff between operational efficiency and performance in real-time provides significant implications for corporate AI strategists.
Research Findings
This research proposes Harmonica, a self-adaptation exemplar designed to address runtime uncertainty, performance degradation, and increasing operational costs encountered by machine learning-based systems (MLS) in real-world environments. Harmonica utilizes a MAPE-K loop—comprising Monitor, Analyze, Plan, Execute, and Knowledge—to monitor system sustainability metrics in real-time. When the system deviates from predefined Adaptation Boundaries, it automatically executes architectural tactics such as model replacement or retraining.
The researchers validated this through two case studies. First, in a time-series regression analysis using California PeMS 2 traffic flow data, they compared Linear Regression, SVM, and LSTM models against static models and simple switching methods. The results showed that the HarmonE approach achieved an of 0.8938, establishing an efficient balance between accuracy and energy consumption (42,645.82J). Second, in a computer vision object detection task using the BDD100K dataset, the feasibility of adaptation strategies was confirmed using three variants (n, s, m) of YOLOv8. Additionally, a user study with 12 experts recorded high usability scores, including ease of installation (4.58/5) and monitoring dashboard clarity (4.41/5).
Executive Key Takeaways
- 1 1. [Utility of Self-Adaptation] Existing MLOps frameworks focus on automation and reliability, lacking runtime adaptation mechanisms to manage broad sustainability metrics such as energy consumption and operational costs in real-time.
- 2 2. [Implications for Operational Efficiency] Enterprise AI leaders should not optimize for model accuracy alone; they must define multi-dimensional sustainability goals, including energy and cost efficiency, during the design phase and implement loops for automated control.
- 3 3. [Challenges in Generalization] Beyond the pyRAPL measurement method optimized for Intel-based hardware, how can platform-agnostic energy proxies be implemented to operate consistently across various OSs, virtualized environments, and heterogeneous hardware?
Is a Self-Adaptive Architecture for Automating the Tradeoff Between Accuracy and Operational Cost Effective?
First, there is the inefficiency of static model operation. According to the time-series regression results (Figure 1 of the source paper), the LSTM model, which showed the highest accuracy, consumed over ten times more energy (76,729.03J) than the LR or SVM models. This proves that a strategy insisting solely on high-performance models regardless of environmental changes leads to a sharp rise in operational costs and can result in over-engineering in specific scenarios.
Second, there are limitations to simple heuristic-based switching. While simply replacing models can reduce energy consumption, it was observed that latency increased and accuracy decreased compared to the HarmonE approach. This suggests that simple replacement strategies performed without sophisticated Analysis (Analyzer) and Planning (Planner) phases struggle to guarantee overall system stability.
Third, there is the issue of lacking visibility in MLOps pipelines. Through the user study, the researchers confirmed that live telemetry and visualization dashboards are key elements for understanding adaptation logic. Considering that many enterprise AI systems are ‘black boxes,’ making it difficult to identify the rationale when an adaptation tactic is executed, clear visualization of monitoring metrics and adaptation boundaries is essential for sustainable MLOps.
Do not rely on a single metric such as ‘accuracy over 95%’; instead, establish Adaptation Boundaries that simultaneously define an ‘energy consumption ceiling’ and ‘minimum acceptable accuracy.’ This prevents unnecessary retraining and maximizes operational efficiency by flexibly switching between lightweight and high-performance models based on the situation.
In-depth Analysis of Harmonica’s MAPE-K Based Self-Adaptive Architecture
Harmonica’s architecture consists of three layers: a Frontend as the user interface, a Managing System that controls the adaptation logic, and a Managed System where the actual ML pipeline operates. The core of this structure is the MAPE-K loop implemented within the Managing System, which optimizes system sustainability through monitoring, analysis, planning, and execution, centered around a Knowledge repository. The architectural design (refer to Figure 1 of the source paper) shows that each component is organically linked to respond to runtime uncertainty.

The Knowledge repository serves as the central hub supplying essential data to all stages of the MAPE-K loop. The Data Repository stores input data required for inference, and System Logs record inference results and adaptation event histories to ensure transparency. In particular, the Sustainability Goals Repository stores Adaptation Boundaries set by the user during the design phase in JSON format, defining the performance and cost thresholds the system must adhere to. Additionally, the Versioned Model Repository archives weights of retrained models, allowing the system to reuse the optimal model without redundant training when similar environmental changes occur.
Examining the detailed operation of the MAPE-K loop, the Monitor first collects real-time metrics such as accuracy, confidence, and energy consumption from system logs. In the subsequent Analyze phase, these metrics are compared against the adaptation boundaries defined in the Sustainability Goals Repository to determine if the system is in a state of drift (outside the permissible range). If a violation is detected, the Planner determines the optimal architectural tactic, such as model replacement or retraining, based on Adaptation Policies. Finally, the Executor applies the decided tactic to the Managed System and updates the result in the system logs, completing the closed-loop control.
The Managed System is the execution unit that performs these control commands. The Inference Subsystem produces results using the currently deployed model via a data pre-processor and inference engine, and the Training Subsystem performs model retraining or fine-tuning according to the executor’s commands. This hierarchical separation provides the structural advantage of ensuring the sustainability of the MLOps pipeline by translating high-level adaptation policies into low-level tactic execution without affecting existing training and inference settings.
Quantitative Result Analysis of Time-Series Regression and Computer Vision Case Studies
The time-series regression analysis (Figure 1 of the source paper) clearly demonstrates the correlation between model complexity and operational cost. Comparing Linear Regression (LR), Support Vector Machine (SVM), and Long Short-Term Memory (LSTM) models using the California PeMS 2 traffic flow dataset, LSTM recorded the highest predictive accuracy with an of 0.9171, but energy consumption reached 76,729.03J. This is approximately 9.2 times higher than the lightest model, LR (8,344.59J), and 8.4 times higher than SVM (9,090.09J).
To overcome these limitations of static models, the HarmonE approach focuses on achieving an optimal balance between predictive performance and resource efficiency. HarmonE maintained a high accuracy of 0.8938 while suppressing energy consumption to 42,645.82J. This result represents an energy reduction of approximately 44% compared to using a static LSTM model while minimizing accuracy loss, proving higher economic and environmental sustainability than a strategy of unconditional high-performance model maintenance.
Superiority of HarmonE is also observed in comparison with the simple Switch method. While the simple switching method showed advantages in energy efficiency with 0.8628 and 28,606.79J of energy consumption, the inference latency was 0.001501 seconds, indicating that performance management was less efficient than HarmonE’s systematic adaptation logic. This suggests that simple model replacement without sophisticated Analysis and Plan phases makes it difficult to simultaneously secure overall system stability and accuracy optimization.
In the computer vision case study (Figure 2 of the source paper), the performance of three YOLOv8 variants (n, s, m) was analyzed using the BDD100K dataset. As model size increased, confidence rose from YOLOv8n (0.5163) to YOLOv8m (0.5679), but energy consumption jumped approximately 4.2 times from 2.954J to 12.634J. The researchers observed that the simple switching strategy recorded a confidence of 0.5262 and energy consumption of 5.153J, verifying that the Harmonica framework provides a practical basis for flexibly operating and evaluating model variants with different resource requirements at runtime.
Validation of Practical Utility of MLOps Exemplar via User Study
To verify the practical utility of Harmonica, a user study was conducted with 12 researchers and practitioners of varying skill levels. The participant group consisted of students (41.7%), researchers (41.7%), and industry practitioners (16.6%), with an average familiarity with Self-Adaptive Systems (SAS) and MLOps of 3.25 on a Likert Scale. Participants were asked to install the system, deploy adaptation scenarios, and modify policies and thresholds to evaluate the tool’s usability from multiple angles.

User evaluation results (Figure 3 of the source paper) showed very high satisfaction across overall metrics. In particular, Ease of Installation averaged 4.58 with a median of 5.0, proving that it lowered the barrier to adopting the MLOps exemplar and contributed to increasing research reproducibility. Clarity of Monitoring Dashboard also scored high, with an average of 4.41 and a median of 4.5, demonstrating excellence in operational visibility.
The relatively lower-scoring item was Intuitiveness of Policy Configuration, which averaged 4.08 with a median of 4.0. This suggests that, separate from functional reliability, further enhancement is needed for the interface used to set complex adaptation policies. Nevertheless, the overall Likelihood to Recommend was very high, with an average of 4.66 and a median of 5.0, acknowledging its practical value.
Qualitative feedback analysis highlighted the Live Telemetry visualization feature as the strongest asset. Participants noted that by observing the trade-offs between sustainability metrics in real-time, they could intuitively understand how the internal complex adaptation logic actually operated. This shows that removing opacity in the MLOps pipeline and providing clear grounds for executing adaptation tactics is a key factor in increasing the acceptance of self-adaptive systems.
In conclusion, Harmonica goes beyond a mere technical implementation to provide a controlled environment where practitioners can experiment with and compare adaptation strategies, thereby establishing a practical foundation for sustainable MLOps. However, given that users suggested a need for explanations of specific tactics, it is judged that adding guidance features such as tooltips would make it an even more complete exemplar.
Threats to Internal Validity and Ecological Validity
To ensure the objectivity of the experimental results, the researchers strictly managed potential threats to internal validity and ecological validity. Considering that background processes could cause fluctuations in energy consumption and performance metrics, they adopted a method of reporting the average after repeating all experiments independently five times. Furthermore, to prevent system instability during consecutive executions, a 20-minute cooldown period was set between each run to stabilize the system environment.
Regarding ecological validity, the hardware dependency of the energy measurement tool acts as a major variable. This study used the pyRAPL library, optimized for Intel processors in a Linux environment, to measure energy consumption. According to the researchers’ analysis, this measurement method is dependent on specific hardware architectures; therefore, absolute energy figures may differ if other processors or measurement tools are used.
Nevertheless, the researchers analyzed that the relative trend of adaptation behavior would remain consistent across different environments. That is, the tendency of a specific model to consume more energy than another, and the mechanism of the self-adaptive loop replacing models in response to thresholds, remain valid regardless of the hardware platform.
Consequently, these limitations were left as tasks for future research. The researchers announced plans to further increase reproducibility in actual deployment environments by integrating platform-agnostic energy proxies applicable across virtualized environments, different operating systems, and heterogeneous hardware, moving beyond hardware-dependent tools like pyRAPL.
Checklist for Adopting Sustainable Self-Adaptive MLOps
- Definition of Sustainability Metrics: Have business constraints such as energy consumption, inference latency, and operational costs been defined as quantitative metrics in addition to accuracy?
- Establishment of Adaptation Boundaries: Have upper and lower thresholds for each metric—where the system must automatically intervene—been finalized during the design phase?
- Securing a Model Spectrum: Are various model variants with different performance and resource consumption levels (e.g., YOLOv8n, s, m) prepared and managed in a replaceable state?
- Feedback Loop Design: Is a closed-loop of the MAPE-K form implemented, where monitoring data goes through analysis and leads to actual model replacement or retraining?
Value of Self-Adaptive Systems from an Operational Cost Optimization Perspective
The core of Harmonica presented in this study is treating the AI model as a ‘variable service’ rather than a ‘fixed asset.’ Most enterprise AI projects focus on peaking model performance, but in actual operation, the computing cost required to maintain that 9% performance gap is often greater than the business value derived from the difference between 99% and 90% accuracy.
Particularly as demands for Green AI intensify, a self-adaptive mechanism that adjusts model complexity at runtime is more than a technical trick; it aligns with strategic goals of ESG management and operational expenditure (OPEX) reduction. However, the key to commercialization will be how to resolve the hardware dependency of measurement tools like pyRAPL used in this study and transfer them to virtualized resource measurement models in actual cloud environments.
Design Principles for Sustainable AI Operations
Three core principles to follow when designing AI architectures to increase system viability:
- Diversification of Goals: Manage energy and cost metrics as Key Performance Indicators (KPIs) on the same level as performance metrics.
- Separation of Adaptation Logic: Separate high-level adaptation policies from low-level execution tactics to allow flexible modification of operational strategies without infrastructure changes.
- Assetization of Versioned Models: Establish a repository system to store past model versions and related data to reduce retraining costs and reuse them when similar environmental changes occur.
Further reading
- Sustainability of Machine Learning-Based Systems: A Practitioner’s Perspective
- Practical Considerations for MLOps Practices: Why Tool Adoption Does Not Prevent Failure
- Why MLOps Maturity Models Are Necessary: Why Best Practice Lists Fail to Transform Organizations
References and Original Analysis Materials
Harmonica: A Self-Adaptation Exemplar for Sustainable MLOps
Authors: Ananya Vishal Halgatti, Shaunak Biswas, Hiya Bhatt, Srinivasan Rakhunathan, Karthik Vaidhyanathan
Venue / Publisher: arXiv
This research briefing was written from the source paper with the help of AI tools (AI Research Agent · MLOps, AI Research Agent · Strategy). Reviewed by Jay PARK, who is responsible for it.
Read more

Tech & MLOps ·
ADAZOR: Hypothesis Testing for Concept Drift Detection in Machine Learning
Tech & MLOps ·
Trust Must Survive Deployment: The Continuous Assurance Lifecycle for Adaptive AI Systems

Tech & MLOps ·
AI Safety and Security Technical Debt in AI-Enabled System Engineering

Tech & MLOps ·
The Limits of Machine Learning Models of Misinformation