Introduction
Machine Learning Control (MLC), including Reinforcement Learning and Model Predictive Control (MPC), offers significant potential for optimizing building energy systems. These models can navigate complex, nonlinear dynamics far more effectively than traditional rule-based systems. However, their adoption is frequently hindered by a "black box" problem: building operators often find these models opaque and unpredictable. This lack of transparency leads to a "trust gap," where operators may override energy-saving strategies—such as precooling before a demand response event—simply because they do not understand the underlying rationale. This research introduces a novel framework that bridges this gap by combining Shapley values with Large Language Models (LLMs) to provide human-readable explanations for automated control decisions.
Methodology: The IML Framework
The proposed Interpretable Machine Learning (IML) framework functions through a three-step process designed to translate technical model outputs into actionable insights for human operators.
- Feature Quantification (SHAP): The system utilizes Shapley Additive Explanations (SHAP), a method from cooperative game theory, to assign a value to each input feature (e.g., outdoor temperature, occupancy, or setpoints). This quantifies exactly how much each specific feature contributed to the model's final prediction.
- Narrative Synthesis (LLM): Raw SHAP values are numerical and often difficult for non-experts to interpret. The framework feeds these values, along with the MPC’s specific goals and constraints, into a Large Language Model (GPT-3.5-turbo).
- Prompt Engineering: Using specialized templates, the LLM packages these technical insights into a coherent narrative. This includes explaining the physical principles involved (e.g., how high outdoor temperatures necessitate more cooling) and the control logic (e.g., the necessity of precooling to avoid future power limit penalties).
The framework also includes an interactive Q&A module, allowing operators to explore "what-if" scenarios, such as the consequences of manually overriding a setpoint during a demand response event.
Experimental Setup
The study was conducted in a controlled virtual environment to ensure safety and rigorous testing:
- Building Model: A DOE reference small office building (511 square meters).
- Simulation Tools: EnergyPlus was used for building dynamics, connected via Py-CoSim to a Python-based MLC controller.
- Weather Data: Typical Meteorological Year (TMY3) data for Tucson, Arizona, provided a challenging hot-climate scenario where cooling is critical.
- Training Data: Generated through "random excitation" of temperature setpoints over a one-month period to ensure an unbiased dataset for the ML models.
Key Insights and Results
The framework demonstrated high reliability and efficiency in translating complex data into logical explanations. A key finding was the LLM's ability to act as a "physics translator," leveraging its inherent knowledge to explain why a SHAP value makes sense—for example, correctly identifying that a lower temperature setpoint increases energy consumption because the system must work harder.
Performance Metrics
- Scenario Identification: The framework achieved a 100% success rate in correctly identifying and explaining different control scenarios across 744 timesteps.
- Computational Efficiency: MPC optimization took approximately 4.19 seconds per control interval, making it suitable for real-time building operations.
- Qualitative Accuracy: LLM-generated explanations were found to be physically accurate and logically consistent with the rule-based rationale of the MPC.
Conclusion and Future Work
By merging data-driven predictions with rule-based constraints into a single narrative, this framework provides a path toward trustworthy AI in building automation. While currently dependent on manually designed prompt templates and tested in simulation, future work will focus on "control-specialized LLM agents" and validation in live, physical building environments. This approach moves the industry away from "black box" automation toward a collaborative model where AI explains its reasoning to human operators.
Summary updated