Using Meta Reinforcement Learning to Bridge the Gap between Simulation and Experiment in Energy Demand Response

Doseok Jang, Lucas Spangher, Manan Khattar, Utkarsha Agwan, Costas J. Spanos · DOI

Abstract

Our team is proposing to run a full-scale energy demand response experiment in an office building. Although this is an exciting endeavor which will provide value to the community, collecting training data for the reinforcement learning agent is costly and will be limited. In this work, we apply a meta-learning architecture to warm start the experiment with simulated tasks, to increase sample efficiency. We present results that demonstrate a similar a step up in complexity still corresponds with better learning.

Introduction

As the global electrical grid increasingly relies on volatile renewable energy sources like wind and solar, demand response (DR) has emerged as a critical mechanism for grid stability. DR programs incentivize consumers to shift their energy usage to periods of high generation. While industrial and residential sectors have established DR protocols, office buildings present a unique challenge: individual workers typically do not bear the direct financial costs of their energy consumption, making behavioral change harder to motivate.

Reinforcement Learning (RL) offers a robust framework for managing these complex interactions. However, RL agents are notoriously "data-hungry." Training an agent to optimize hourly energy pricing in a real-world office environment would require months of live data collection—a process that is both prohibitively expensive and risky for a live experiment. This research addresses the "simulation-to-experiment gap" by utilizing meta-learning to provide RL agents with a "warm start," enabling effective performance from the moment of deployment.

Methodology

The proposed system utilizes a closed-loop control architecture where an RL agent interacts with simulated office workers to optimize energy consumption based on utility prices.

Reinforcement learning control loop for energy demand response.

The architecture integrates two primary components:

  1. Proximal Policy Optimization (PPO): A robust RL algorithm serving as the base controller to determine hourly price signals (or "points") for building occupants.
  2. Model-Agnostic Meta-Learning (MAML): A meta-learning layer that optimizes for a weight initialization capable of rapid adaptation. Instead of solving a single task, MAML trains the agent to "learn how to learn" across a distribution of simulated human behaviors.

Training was conducted using OfficeLearn, an OpenAI Gym environment. The simulation environment modeled various human response types, ranging from simple deterministic functions (linear, sinusoidal, threshold) to a complex "Curtail and Shift" model. The latter accounts for fixed loads (PCs), curtailable loads (printing), and shiftable loads (laptop charging). Simulations were grounded in two months of historical energy distribution data.

Results and Discussion

The primary finding of this study is that MAML-initialized agents significantly outperform standard RL agents in both speed of adaptation and final performance.

Adaptation performance of MAML+PPO versus standard PPO across different simulated response models.

Sample Efficiency and Generalization

The MAML+PPO approach demonstrated a massive leap in sample efficiency. While a standard PPO agent requires approximately 100 simulated days to reach a stable performance baseline, the meta-learned agent achieved comparable results in fewer than 48 hours. Furthermore, the agent showed remarkable generalization; when pre-trained on simple deterministic models, it adapted effectively to the more complex and realistic "Curtail and Shift" behaviors.

Performance Metrics

By the end of the training period, the MAML+PPO approach reduced total simulated energy costs by approximately 40% compared to the baseline PPO agent. The reward function, which includes penalties for failing to meet baseline energy demands, ensured that the agent learned to balance the grid rather than simply minimizing prices.

Stability and Hyperparameters

The stability of the meta-learning process was found to be sensitive to the number of inner-loop iterations. While 50 iterations led to instability, 200 iterations provided a "sweet spot" for a stable, high-performing initialization.

Conclusion and Future Work

This work demonstrates that meta-reinforcement learning can effectively bridge the gap between simulation and real-world deployment in energy demand response. By drastically reducing the data requirements for live experiments, MAML enables more practical and scalable deployment of RL controllers in building management.

Future research will focus on integrating "Surprise-Minimizing" reward regularizers and exploring multi-agent architectures (such as TD3) to better capture complex building dynamics. The ultimate objective remains the deployment of this MAML-optimized controller in a full-scale experiment with real office workers to validate these simulated findings in a physical environment.

Summary updated

BibTeX
@inproceedings{jang2021using,
  author = {Doseok Jang and Lucas Spangher and Manan Khattar and Utkarsha Agwan and Costas J. Spanos},
  title = {{Using Meta Reinforcement Learning to Bridge the Gap between Simulation and Experiment in Energy Demand Response}},
  booktitle = {e-Energy},
  year = {2021},
  url = {https://openreview.net/forum?id=ERhnOPbATg},
}
Figure