Abstract
Self-adaptive systems (SAS) are designed to adjust their behavior autonomously in response to environmental changes, such as fluctuating web traffic. Traditionally, these systems rely on rule-based adaptation logic, which is difficult to design and tune manually. This paper explores the integration of Large Language Models (LLMs) into the classic MAPE-K (Monitor-Analyze-Plan-Execute-Knowledge) loop to automate the discovery and optimization of these rules. By leveraging the reasoning capabilities of models like GPT-4 and DeepSeek-Coder-V2, the proposed framework demonstrates the ability to generate complex, high-performing adaptation rules that significantly outperform traditional manual designs in simulated web infrastructure environments.
Introduction
In modern cloud computing, self-adaptation is essential for maintaining service level objectives while minimizing operational costs. Engineers typically use rule-based systems to trigger actions—such as scaling server capacity—based on monitored thresholds. However, the "design space" for these rules is immense, requiring engineers to select optimal variables, thresholds, and logic. Manual tuning is often tedious, while traditional reinforcement learning approaches can require thousands of iterations to converge.
This research proposes a shift toward LLM-driven optimization. By treating the LLM as a reasoning agent within the adaptation loop, the system can utilize "common-sense" heuristics about infrastructure management to arrive at optimal configurations much faster than traditional black-box optimization algorithms.
Methodology: The LLM-Integrated MAPE-K Loop
The researchers implemented their automated pipeline based on the MAPE-K reference architecture, a standard in self-adaptive software engineering. The LLM is integrated into the loop as follows:
- Knowledge Base: The LLM is provided with a comprehensive context, including the application domain, specific business goals (e.g., "maximize revenue while minimizing cost"), available system variables, and historical operational data.
- LLM-driven Analyzer & Planner: Instead of relying on a static algorithm, the LLM analyzes historical performance data to identify "pain points" (e.g., instances where response times exceeded limits) and plans updates to the adaptation rules.
- Code Generation: The LLM generates updated adaptation rules directly in C++ code.
- Execution and Feedback: This code is executed within a simulator. The resulting performance metrics are fed back into the Knowledge Base, allowing the LLM to learn from the success or failure of its previous suggestions in the next iteration.
Two primary models were evaluated in this study: GPT-4 and DeepSeek-Coder-V2.
Experimental Setup
The framework was evaluated using the SWIM (Simulator for Web Infrastructure and Management). The researchers utilized the "Clarknet-105m-I70" configuration, which simulates a challenging environment with significant fluctuations in web traffic. The primary metric for success was a "utility function"—a mathematical score representing the revenue generated by the system minus the operational costs of running servers.
Key Insights and Results
Reasoning over Randomness
Unlike traditional optimization algorithms that often begin with random exploration, LLMs utilize prior knowledge. They understand fundamental relationships—such as the correlation between server count and latency—allowing them to generate high-performing rules as early as the first round of optimization. This "warm start" capability is a significant advantage over traditional meta-heuristics.
Automated Feature Engineering
The LLMs demonstrated an ability to perform automated feature engineering. Rather than just tweaking numerical thresholds, the models independently decided which variables were most relevant and occasionally combined multiple variables to create more sophisticated triggers for adaptation.
Performance Benchmarks
Both GPT-4 and DeepSeek-Coder-V2 achieved utility scores of approximately 5.5k at their peak. This performance significantly exceeded the default manual rules provided in the SWIM simulator. While the default rules utilized 8 different variables, the LLMs were able to navigate this multi-dimensional space to find more nuanced logic than a human designer typically would.
The Iterative Nature of LLM Optimization
The study observed that performance does not always improve linearly. Because LLMs explore a complex design space, they occasionally suggest rules that perform worse than previous iterations (negative utility). This highlights the necessity of an iterative "trial-and-error" process and a robust feedback loop to discard regressive rules.
Limitations and Future Directions
While promising, the current approach has limitations. The LLM explores only one set of rules per iteration, which can be computationally expensive compared to mathematical optimization. Furthermore, the stochastic nature of LLMs means the system can occasionally regress in performance.
Future work will focus on moving from "design-time" optimization to runtime evolution, where the LLM could update rules on the fly as it encounters unforeseen environmental conditions. Additionally, the authors suggest exploring LLMs as "meta-heuristics" that guide faster, traditional search methods to combine reasoning with computational efficiency.
Summary updated