TL;DR
This paper introduces a hierarchical control framework that combines Large Language Models (LLMs) and Reinforcement Learning (RL) to optimize multi-zone HVAC operations for energy efficiency and occupant comfort. By using a fine-tuned LLM to generate state-dependent "action masks," the framework prunes massive combinatorial action spaces, allowing the RL agent to safely and efficiently find optimal control policies. Tested on a realistic 7-zone office building simulator, this approach significantly reduces both thermal discomfort and energy consumption compared to standalone RL or LLM baselines.
What Problem Does This Paper Address?
Heating, ventilation, and air conditioning (HVAC) systems are notorious energy hogs, accounting for roughly 32% of global energy consumption and 34% of global CO2 emissions. Making these systems more efficient through occupant-centric control (OCC) is vital for decarbonization, but it is incredibly challenging due to weather uncertainties and dynamic human behavior.
Reinforcement Learning (RL) is a popular candidate for this task because it excels at balancing long-horizon trade-offs (like comfort vs. energy savings). However, in multi-zone buildings, RL suffers from the "curse of dimensionality"—the joint action space grows exponentially with every added zone, leading to highly unstable training and inefficient exploration. Furthermore, pure trial-and-error exploration can result in extreme discomfort for occupants or aggressive equipment cycling. While Large Language Models (LLMs) can understand operational rules and context, they lack closed-loop numerical optimization capabilities, often leading to inefficient over-conditioning when used alone.
Methods
The authors propose a hybrid, hierarchical control framework that splits the labor between an LLM and an RL agent:
- Upper Layer (LLM Action Masking): A pre-trained LLM (Meta-Llama-3-8B-Instruct) is fine-tuned using Low-Rank Adaptation (LoRA) on historical building data. Instead of directly controlling the HVAC system, the LLM processes serialized recent building states (temperatures, occupancy counts, previous fan speeds) and generates a localized, operationally plausible subset of actions (an "action mask") for each zone.
- Lower Layer (RL Optimization): A value-based Deep Q-Network (DQN) agent takes the LLM's action mask and performs constrained numerical optimization only within this drastically reduced search space.
- Inference Caching: To bypass the computational latency of querying an LLM every 5 minutes, the authors implement an "LLM + cache" strategy. Common state-action mask pairs are stored in an offline cache, allowing the system to instantly retrieve masks for known states and only query the LLM when encountering completely novel scenarios.
The prompt engineering architecture ensures the LLM understands spatial topologies (e.g., distinguishing between independent offices and interconnected halls) and occupancy impacts:
Datasets
The framework was trained and evaluated using real-world operational data collected from a commercial office building in Hebei Province, China, between August 7 and August 22, 2021. The dataset includes synchronized 1-minute and 5-minute interval logs of outdoor weather, zone air temperatures, fan coil unit (FCU) states, water loop pressures, and camera-based occupancy counts.
This data was used to calibrate a high-fidelity HVAC simulator that served as the closed-loop training and evaluation environment for the RL agent.
Key Insights and Ideas
- The Power of Pruning: In a 7-zone building where each zone has 4 fan speeds, the total joint action space is $4^7 = 16,384$ possible actions. The fine-tuned LLM successfully eliminated approximately 81.56% of this combinatorial space on average, dramatically reducing the exploration burden on the RL agent.
- Structure Over Scale: Simply scaling up a standalone LLM (e.g., moving from Llama-3-8B to Qwen2.5-72B) improves occupant comfort but significantly increases energy consumption because larger models default to conservative over-cooling. True efficiency stems from the hierarchical structure (LLM for bounding, RL for optimizing) rather than model size alone.
- Cold-Start Safety: Even before any reward-driven RL training takes place, uniform random exploration within the LLM's masked action space reduces total energy consumption by 22.10% and average thermal discomfort by 24.16% compared to unconstrained random exploration. This makes the system substantially safer for real-world deployment.
Key Results
- Superior Comfort: The hierarchical framework achieved a mean Predicted Percentage of Dissatisfied (PPD) occupants of 7.30%, representing a 39.1% reduction in discomfort relative to vanilla DQN and a 53.1% reduction relative to the best standalone LLM baseline.
- Lower Energy Consumption: The proposed method reduced daily HVAC energy consumption to 140.90 kWh, outperforming all vanilla RL baselines (such as PPO at 152.53 kWh and DQN at 157.13 kWh).
- Negligible Latency: The LLM + cache strategy reduced the average online control step latency by 96.16% (down to just 0.087 seconds), successfully removing the computational bottleneck of real-time LLM inference.
Limitations and Future Work
Despite its strong performance, the framework's effectiveness is tightly coupled with the quality and comprehensiveness of the historical building data used to fine-tune the LLM. Poor historical data could lead to overly restrictive or inaccurate action masks.
Additionally, this study was limited to discrete fan-speed control during a summer cooling season. The authors note that future work should focus on extending the framework to continuous control variables (such as chilled water flow rates), adapting it for winter heating seasons, and validating its generalizability across more diverse building architectures.
Summary updated