STEMS: Spatial–Temporal-Enhanced Safe Multiagent Coordination for Building Energy Management

Huiliang Zhang, Di Wu, Arnaud Zinflou, Benoît Boulet

TL;DR

This paper introduces STEMS, a novel framework for coordinating energy management across multiple buildings. STEMS uses a GCN-Transformer architecture to understand how buildings interact spatially and temporally, and integrates Control Barrier Functions (CBFs) to guarantee operational safety. This approach significantly reduces energy costs, emissions, and safety violations while maintaining occupant comfort.

What Problem Does This Paper Address?

Buildings are major energy consumers, contributing significantly to global energy use and CO2 emissions. Efficiently managing energy in buildings is crucial for reducing costs, improving occupant comfort, and meeting environmental goals. However, coordinating energy management across multiple buildings presents significant challenges. Current systems often operate in isolation, failing to exploit the complex spatial relationships (like proximity and shared infrastructure) and temporal patterns (like usage spikes) between buildings. This uncoordinated approach can lead to inefficiencies, grid instability, and safety risks, such as equipment overload or battery damage. Furthermore, existing methods often lack rigorous safety guarantees, relying on soft constraints that may still permit unsafe actions during learning or operation. The inherent complexity of these multi-building systems, coupled with dynamic energy sources and pricing, makes finding optimal, safe, and comfortable solutions a difficult multi-objective optimization problem.

Methods

STEMS tackles these challenges with a two-pronged approach:

  1. Spatial-Temporal Graph Representation Learning: This component uses a GCN-Transformer fusion architecture to capture the intricate relationships between buildings.
  2. Graph Construction: Buildings are represented as nodes in a graph, with edges weighted by geographical proximity and attribute similarity.
  3. GCN (Graph Convolutional Network): Aggregates information from neighboring buildings to understand spatial dependencies in energy consumption.
  4. Transformer (Attention Mechanism): Models temporal patterns in energy usage and environmental conditions.
  5. Selective Information Sharing: A novel mechanism allows buildings to dynamically decide what information to share based on spatial-temporal contexts, improving collaboration.
  6. Safety-Constrained Multi-Agent Reinforcement Learning (RL): This module ensures that the coordinated actions are safe.
  7. Control Barrier Functions (CBFs): Integrated as "safety shields" to provide mathematical guarantees that control actions will not violate predefined safety constraints (e.g., battery limits, power capacity).
  8. Predictive Safety Checking: A mechanism that verifies proposed actions against CBFs before execution, preventing unsafe actions and ensuring reliable operation.
  9. Multi-Objective Reward Function: Balances economic efficiency, operational stability, occupant comfort, and renewable energy utilization.

The overall framework uses an actor-critic RL architecture where the learned spatial-temporal representations from the graph module serve as input to both the actor (action generation) and critic (value estimation) networks.

Datasets

The paper uses the CityLearn environment for simulation, which is based on real building energy consumption data from Travis County, Texas. This dataset spans a full year and includes hourly measurements of electricity consumption, solar generation, battery storage, and environmental conditions. For cross-climate generalization, they also use the Vermont, Chittenden County dataset, which exhibits cold-dominant characteristics.

Key Insights and Ideas

  • The Power of Inter-Building Relationships: The research strongly emphasizes that ignoring spatial and temporal dependencies between buildings leads to suboptimal energy management. STEMS demonstrates that explicitly modeling these relationships is key to achieving significant improvements.
  • Formal Safety Guarantees are Crucial: Relying on penalty terms in RL for safety is insufficient. The integration of Control Barrier Functions provides a robust mathematical framework for ensuring operational safety, especially critical during extreme events or when systems operate at their limits.
  • GCN-Transformer Fusion is Effective: Combining graph neural networks for spatial context with transformers for temporal dynamics provides a powerful representation for complex, interconnected systems like multi-building energy networks.
  • Adaptability Across Building Types and Climates: STEMS shows strong performance not only in a mixed-use, subtropical climate but also demonstrates robustness and adaptability in a cold-dominant residential setting, highlighting its generalizability.

Key Results

STEMS demonstrates significant improvements over baseline methods:

  • Cost Reduction: 21% reduction compared to traditional methods and 1-2.5% reduction over state-of-the-art baselines.
  • Emission Reduction: 18% reduction compared to traditional methods.
  • Safety Violation Reduction: A remarkable 65% reduction compared to learning-based baselines and up to 70-81% reduction compared to other methods during extreme weather.
  • Discomfort Rate: Maintains the lowest discomfort rate among all evaluated methods.
  • Robustness: Performs well under extreme weather conditions (heat waves, cold waves) and during simulated power outages, maintaining safety and efficiency.
  • Computational Efficiency: Achieves comparable training times to other advanced methods while offering superior safety and performance. Inference time is very fast (24 ms per building).

Limitations and Future Work

  • Scalability: While STEMS scales linearly with building count for model size, training time follows O(N²) complexity due to graph message passing. Though acceptable for offline training, this quadratic scaling could be a bottleneck for extremely large deployments.
  • Uncertainty in Renewable Energy: The authors suggest extending the robustness of the multi-agent RL algorithm and CBF safety mechanisms to handle different types of uncertain renewable energy generation.
  • Outage Awareness: Incorporating outage-aware training could further enhance resilience.
  • Large-Scale Networks: Future work aims to scale STEMS to larger building networks while maintaining real-time performance guarantees.

Summary updated

BibTeX
@article{zhang2025stems,
  author = {Huiliang Zhang and Di Wu and Arnaud Zinflou and Benoît Boulet},
  title = {{STEMS: Spatial–Temporal-Enhanced Safe Multiagent Coordination for Building Energy Management}},
  journal = {IEEE Internet of Things Journal},
  year = {2025},
  doi = {10.1109/jiot.2025.3645808},
}
Figure