Generalizing HVAC Control With Domain Randomized Reinforcement Learning
Summary
The paper proposes NOMAD-RL, a reinforcement learning controller for HVAC systems that uses adaptive domain randomization to generalize across heterogeneous thermal zones, approaching the performance of model predictive control.
View Cached Full Text
Cached at: 09/10/26, 08:25 AM
# Generalizing HVAC Control With Domain Randomized Reinforcement Learning Source: [https://arxiv.org/html/2609.05822](https://arxiv.org/html/2609.05822) Conference:ACM Sustainability Week 2026; June 22–25, 2026; Banff, AB, CanadaACM Sustainability Week 2026 \(ACM Sustainability Week Companion ’26\), June 22–25, 2026, Banff, AB, CanadaDOI:[10\.1145/3765611\.3815359](https://doi.org/10.1145/3765611.3815359)ISBN:979\-8\-4007\-2199\-1/2026/06CCS:Applied computing EngineeringCCS:General and reference General conference proceedingsCCS:Computing methodologies Control methodsPablo Boitelemail:[pablo\.boitel\.1@ens\.etsmtl\.ca](mailto:[email protected])Affiliation:École de technologie supérieure \(ÉTS\),Montréal,Québec,CanadaKun Zhangemail:[kun\.zhang@etsmtl\.ca](mailto:[email protected])Affiliation:École de technologie supérieure \(ÉTS\),Montréal,Québec,Canada © cc ###### Abstract\. Deploying advanced HVAC \(Heating, Ventilation and Air Conditioning\) controllers at scale remains difficult because performance often depends on accurate building models or per\-site retuning\. We proposeNOMAD\-RL\(Neural Online Meta\-Adaptation for Dynamics\), a general\-purpose Reinforcement Learning \(RL\) controller designed to transfer across heterogeneous thermal zones through a universal, non\-invasive thermostat interface\. The controller acts on temperature setpoints from zone measurements and forecasts, while a recurrent policy supports online adaptation under partial observability\. Our main contribution is an adaptive domain randomization scheme based on physics\-informed normalizing flows, which models correlated and multimodal distributions of thermal\-zone parameters while maintaining physical plausibility and controllability\. This produces a realistic and progressively adaptive training curriculum that improves transfer across buildings\. We evaluateNOMAD\-RLagainst a constant\-setpoint PID controller, RL without domain randomization, and MPC in single\- and multi\-zone settings\.NOMAD\-RLconsistently outperforms the PID and non\-randomized RL baselines, and approaches the performance of a well\-tuned MPC, especially in the more challenging multi\-zone case\. These results highlight the potential of adaptive, physics\-informed domain randomization for robust and transferable HVAC control\. ###### Keywords: HVAC, Reinforcement learning, Control, Domain randomization ††cc\-license:by## 1\.Introduction Buildings account for30%30\\%of global final energy use and26%26\\%of energy\-relatedCO2CO\_\{2\}emissions\([International Energy Agency,](https://arxiv.org/html/2609.05822#bib.bib1)\), making HVAC control a promising lever for reducing both operating costs and emissions\. Model Predictive Control \(MPC\) remains the reference approach because it can explicitly balance comfort and energy use under operational constraints\. However, its large\-scale deployment is limited by the effort required to derive, calibrate, and maintain accurate models, especially beyond simple single\-zone settings\([et al\., 2020](https://arxiv.org/html/2609.05822#bib.bib2);[et al\., 2023](https://arxiv.org/html/2609.05822#bib.bib7)\)\. Reinforcement Learning \(RL\) has therefore emerged as an alternative\. Yet RL offers little advantage when it also relies on highly calibrated simulators: MPC depends on models explicitly, whereas RL depends on them implicitly through training environments\. This motivates a different objective for RL in HVAC control: learn controllers that transfer across heterogeneous thermal zones\. The key intuition is that many physically different zones, exhibit similar closed\-loop behavior when controlled through a thermostat interface\. A controller trained across varied zones, while retaining memory of past dynamics and adapting online, can therefore learn transferable strategies rather than zone\-specific heuristics\. We proposeNOMAD\-RL\(NeuralOnlineMeta\-Adaptation forDynamics\), a general\-purpose RL controller designed for this setting\.NOMAD\-RLacts through a universal thermostat interface and uses recurrent policies to handle partial observability and online adaptation\. To promote transfer, training relies on adaptive domain randomization over thermal\-zone dynamics\. Rather than sampling simulator parameters independently, we model their joint distribution with neural spline flows and constrain it with physics\-informed regularization so that training remains both diverse and physically plausible\. Our contributions are fourfold\. First, we introduce a flow\-based adaptive domain randomization scheme that captures correlated and multimodal distributions of thermal\-zone parameters\. Second, we enforce physical plausibility and controllability through physics\-informed regularization\. Third, we propose a stable training objective based on a context\-normalized reward and a Boltzmann target with gradient\-refined candidates, improving sample efficiency in high dimension\. Fourth, we combine this curriculum with a recurrent RL controller that exploits interaction history and forecasts to support rapid adaptation under partial observability\. Experiments in both single\-zone and multi\-zone settings show thatNOMAD\-RLconsistently outperforms constant\-setpoint and non\-randomized RL baselines, while approaching the performance of a well\-tuned MPC\. These results suggest that adaptive, physics\-informed domain randomization can make RL a practical path toward robust and transferable HVAC control across diverse buildings\. Figure 1\.Architecture ofNOMAD\-RL ## 2\.Method We consider a general and practical control setting in which the agent interacts with the building through a standard thermostat interface\. Rather than directly controlling the heating plant, the controller observes zone temperature and power, adjusts the temperature setpoint\. This supervisory control approach improves safety, since actions can be constrained within a reasonable comfort range, preserves interpretability, and avoids learning low\-level actuation already handled by existing PID loops\. It also promotes transfer across buildings, as closed\-loop thermostat\-level behavior tends to be more consistent than plant dynamics\. See Fig\.[1](https://arxiv.org/html/2609.05822#S1.F1)for an overview of the architecture ofNOMAD\-RLand details are given below\. ### 2\.1\.Thermal zone modeling In this work, we use a generic thermal\-zone simulator based on a fifth\-order resistance\-capacitance \(RC5\) model coupled with a hydronic heat pump and a low\-level PID controller; following\([et al\., 2022](https://arxiv.org/html/2609.05822#bib.bib3)\)\. The model is implemented in JAX to support efficient simulation and automatic differentiation\. The parameters include those of building envelope, internal mass, heat pump characteristics, and PID gains, resulting in a 25\-dimensional domain space\. This compact but expressive setup provides a convenient testbed for evaluating transfer, robustness, and adaptive domain randomization, while still allowing strong MPC baselines to be computed on the nominal model\. ### 2\.2\.Reinforcement learning controller We formulate HVAC control as a partially observable sequential decision\-making problem \(POMDP\)\. Since the controller does not observe the full thermal states of the building, it must act from limited measurements and delayed effects\. This motivates a recurrent RL policy to infer hidden dynamics from interaction history\. At each step, the agent observes the current zone temperature, power consumption, comfort bounds, outdoor conditions, occupancy, electricity price, and time features, together with short\-term forecasts of the main exogenous inputs\. Rather than directly controlling the heating plant, the policy outputs an incremental update to the thermostat setpoint, clipped to a safe comfort range\. This preserves interpretability, simplifies deployment, and keeps low\-level actuation handled by the existing PID loop\. Forecast trajectories are encoded with a temporal convolution module and fused with current measurements into a compact latent representation\. This representation is then passed to a recurrent LSTM\-based actor–critic policy, providing the required memory to adapt online to partially observed and changing dynamics\. We train the controller with Recurrent PPO, using the standard actor–critic implementation from the SB3\-Contrib library\. The reward reflects the operational HVAC objective: minimizing electricity cost, maintaining comfort and avoiding excessive actuator saturation\. To make training comparable across heterogeneous buildings and operating conditions, we use a normalized reward relative to a fixed\-setpoint PID reference rollout computed at the start of each episode\. This replay\-based normalization differs from the standard online RL setting, where trajectories are stochastic, non\-reproducible, and cannot be exactly replayed\. It therefore provides a stable learning signal under domain randomization and measures improvement over a simple but realistic reference controller\. ### 2\.3\.Domain randomization for RL training To promote transfer across heterogeneous thermal zones, we train the policy under domain randomization\. At the beginning of each episode, all the simulator parametersξ∈ℝ25\\xi\\in\\mathbb\{R\}^\{25\}are sampled from a distributionpϕ\(ξ\)p\_\{\\phi\}\(\\xi\), while the policy does not observeξ\\xidirectly\. Training therefore optimizes expected return over a family of environments rather than a single nominal model\. The main challenge is to adaptpϕp\_\{\\phi\}so that it generates informative and realistic environments: if the distribution is too narrow, the policy overfits; if it is too broad, training becomes unstable\. Building upon previous work\([OpenAI, 2019](https://arxiv.org/html/2609.05822#bib.bib6);[et al\., 2024](https://arxiv.org/html/2609.05822#bib.bib4);[et al\.,](https://arxiv.org/html/2609.05822#bib.bib5)\), we address this challenge with an adaptive domain randomization scheme based on normalizing flows\. We representpϕ\(ξ\)p\_\{\\phi\}\(\\xi\)with a neural spline flow, which can model correlated, multimodal, and high\-dimensional parameter distributions\. Rather than optimizing the flow directly through noisy gradients, we construct an empirical Boltzmann target over candidate environments and fit the flow to it by weighted maximum likelihood, yielding a more stable update\. To remain effective in high\-dimensional settings, candidate parameters are first sampled uniformly over the admissible domain, then refined through a few gradient steps\. Each random draw thus becomes a short local search trajectory, which improves coverage of the parameter space\. Each candidate is evaluated using three components: the return under the current policyJθ\(ξ\)J\_\{\\theta\}\(\\xi\), a physical plausibility costCP\(ξ\)C\_\{P\}\(\\xi\), and a surprise bonuslogpϕ\(ξ\)\\log p\_\{\\phi\}\(\\xi\)that promotes exploration\. The resulting utilityU\(ξ\)U\(\\xi\), which measures the relevance of a parameter vector \(higher is better\), is defined as \(1\)U\(ξ\)=Jθ\(ξ\)−λphysCP\(ξ\)\+λsur\(−logpϕ\(ξ\)\)U\(\\xi\)=J\_\{\\theta\}\(\\xi\)\-\\lambda\_\{\\mathrm\{phys\}\}C\_\{P\}\(\\xi\)\+\\lambda\_\{\\mathrm\{sur\}\}\\bigl\(\-\\log p\_\{\\phi\}\(\\xi\)\\bigr\) This utility yields the Boltzmann weights, i\.e\., the analytical solution of the associated expectation\-maximization problem: \(2\)wi=softmax\(U\(ξi\)τ\)iw\_\{i\}=\\mathrm\{softmax\}\\left\(\\frac\{U\(\\xi\_\{i\}\)\}\{\\tau\}\\right\)\_\{i\}whereτ\\taucontrols how concentrated the distribution is\. The physical costCP\(ξ\)C\_\{P\}\(\\xi\)constrains the curriculum to realistic and controllable regions of the parameter space by penalizing implausible heat\-pump efficiencies, poor comfort regulation under a fixed\-setpoint baseline controller, and excessive actuator saturation\. Figure[2](https://arxiv.org/html/2609.05822#S2.F2)shows a 2D slice of the resulting learned distribution in the\(gA,Ci\)\(gA,C\_\{i\}\)space, i\.e\., equivalent solar area and internal capacitance\. Figure 2\.2D slice of the learned parameter\-flow distribution in the\(gA,Ci\)\(gA,C\_\{i\}\)space over the target Boltzmann distribution \(left\) and their correlation \(right\)The parameter distribution is then updated from the weighted candidate set using a Boltzmann\-weighted negative log\-likelihood with a KL trust region: \(3\)minϕL\(ϕ\)=−∑i=1Nwilogpϕ\(ξi\)\+βDKL\(pϕ∥pϕold\)\\min\_\{\\phi\}\\quad L\(\\phi\)=\-\\sum\_\{i=1\}^\{N\}w\_\{i\}\\log p\_\{\\phi\}\(\\xi\_\{i\}\)\+\\beta D\_\{\\mathrm\{KL\}\}\\\!\\left\(p\_\{\\phi\}\\,\\\|\\,p\_\{\\phi\_\{\\mathrm\{old\}\}\}\\right\) This stabilizes successive updates while allowing the distribution to expand gradually as the policy improves\. Overall,NOMAD\-RLalternates between updating the recurrent policy on environments sampled from the current flow and updating the flow from refined candidates scored by utility, yielding an adaptive curriculum over realistic thermal\-zone dynamics \(see the Algorithm 1 for the steps\)\. ### 2\.4\.Training configuration Training was limited to a preliminary6e66e6\-steps run on a single CPU/GPU, using Algorithm[1](https://arxiv.org/html/2609.05822#alg1), with limited hyperparameter tuning\. Fig\.[3](https://arxiv.org/html/2609.05822#S2.F3)illustrates a representativeNOMAD\-RLtraining episode in our tuned GYM environment, showing the full sequence of actions and observations\. High\-price events \(red\) are periods the controller must anticipate, where power should be minimized\. Low\-occupancy periods \(blue\) indicate times when temperature may temporarily drift outside comfort bounds without penalty\. The episode starts with a warm\-up phase \(yellow\)\. The figure also reports the constant\-setpoint baseline, weather forecasts, power and COP trajectories, and an example occupancy profile\. Algorithm 1NOMAD\-RL0:policy parameters θ\\theta, flow parameters ϕ\\phi 1:for n=1n=1to NNdo 2:Train Policy\(θ,pϕ\)\(\\theta,p\_\{\\phi\}\) 3: 𝒟←Sample And Refine\(𝒳,U\)\\mathcal\{D\}\\leftarrow\\textsc\{Sample And Refine\}\(\\mathcal\{X\},U\) 4: w←Boltzmann Weights\(𝒟,U\)w\\leftarrow\\textsc\{Boltzmann Weights\}\(\\mathcal\{D\},U\) 5:Update Flow\(ϕ,𝒟,w\)\(\\phi,\\mathcal\{D\},w\) 6:endfor Figure 3\.Behavior of the NOMAD\-RL controller during training\. ## 3\.Results and evaluation of NOMAD\-RL After training, we evaluateNOMAD\-RLagainst a constant set\-point PID controller, a recurrent PPO baseline trained without domain randomization, and MPC\.Costs are reported in euros, reflecting energy consumption, comfort, and saturation\. Percentages use\(Cref−CNOMAD\)/Cref×100\(C\_\{\\mathrm\{ref\}\}\-C\_\{\\mathrm\{NOMAD\}\}\)/C\_\{\\mathrm\{ref\}\}\\times 100; negative values mean thatNOMAD\-RLis more costly than the reference\. ### 3\.1\.Single\-zone setting We first compareNOMAD\-RLwith a recurrent PPO agent trained on a single fixed environment\. Both policies are evaluated on the nominal zone and under randomized dynamics to assess robustness and out\-of\-domain generalization\. We also compare them with MPC and a constant set\-point PID controller on a representative sampled zone\. In this setting, MPC has access to the exact thermal\-zone model and serves as a near\-global optimum reference\. Figure 4\.NOMAD\-RL vs\. recurrent PPO without domain randomization on the nominal thermal zone\.Figure 5\.NOMAD\-RL vs\. recurrent PPO without domain randomization vs\. MPC on a sampled thermal zone\.As shown in Fig\.[4](https://arxiv.org/html/2609.05822#S3.F4), both RL controllers clearly outperform the constant set\-point PID baseline\.NOMAD\-RLreduces cost by70\.4%70\.4\\%relative to PID, but is8\.7%8\.7\\%more costly than recurrent PPO on the nominal zone\. On the sampled zone with shifted dynamics \(Fig\.[5](https://arxiv.org/html/2609.05822#S3.F5)\),NOMAD\-RLreduces cost by60\.1%60\.1\\%relative to PID and51\.4%51\.4\\%relative to recurrent PPO, while being46\.6%46\.6\\%more costly than MPC\. This is notable because MPC has access to the exact model and therefore approximates the global optimum in this setting\. ### 3\.2\.Multi\-zone setting We compareNOMAD\-RLwith per\-zone MPC and constant\-setpoint PID on a 3\-zone building with inter\-zone thermal coupling, using the building\-level cumulative cost aggregated over the three zones\. NOMAD\-RLremains effective in this more challenging setting: it reduces cost by67\.9%67\.9\\%relative to constant\-setpoint PID and is14\.5%14\.5\\%more costly than MPC\. The gap to MPC narrows as the problem becomes more complex, suggesting robustness in complex environments\. ## 4\.Conclusion This work addresses a central challenge in scalable HVAC control: achieving robust performance across heterogeneous thermal zones without per\-site modeling or retuning\. We introducedNOMAD\-RL, a general\-purpose RL controller built on a universal thermostat interface that preserves safety, interpretability, and practical deployability\. This supervisory approach is non\-invasive and lightweight enough for embedded devices or connected thermostats\. Our main contribution is an adaptive domain randomization framework based on physics\-informed normalizing flows\. By learning multimodal, correlated distributions over thermal\-zone parameters while enforcing physical plausibility and controllability, the framework generates a realistic and progressively expanding training curriculum\. Combined with a recurrent policy leveraging past observations and forecasts, it yields transferable control policies capable of rapid online adaptation in a meta\-learning setting\. Results support this approach\. In single\-zone settings,NOMAD\-RLoutperforms PID and non\-randomized RL baselines, while remaining within46\.6%46\.6\\%of MPC on the sampled zone\. In multi\-zone settings, it reduces PID cost by67\.9%67\.9\\%and remains within14\.5%14\.5\\%of MPC\. This suggests thatNOMAD\-RLprovides a path toward generalizable HVAC control without accurate models\. Future work will focus on improving performance and real\-world readiness through further training, hyperparameter tuning, expansion of the simulator and dataset pipeline, and validation on real buildings\. We also plan to evaluateNOMAD\-RLon HVAC benchmarks for generalization, and explore larger architectures, transformers, and flow matching for domain randomization\. The implementation used in this work is publicly available\.111[https://github\.com/paabL/NOMAD\-RL](https://github.com/paabL/NOMAD-RL) ## References - et al\. \(2022\)A\. et al\.Reinforced model predictive control \(RL\-MPC\) for building energy management\.Applied Energy309,pp\. 118346\.External Links:ISSN 0306\-2619,[Link](https://www.sciencedirect.com/science/article/pii/S0306261921015932),[Document](https://dx.doi.org/10.1016/j.apenergy.2021.118346)Cited by:[§2\.1](https://arxiv.org/html/2609.05822#S2.SS1.p1.1)\. - \[2\]C\. et al\.Flow\-based Domain Randomization for Learning and Sequencing Robotic Skills\.\(en\)\.Cited by:[§2\.3](https://arxiv.org/html/2609.05822#S2.SS3.p2.1)\. - et al\. \(2020\)D\. et al\.All you need to know about model predictive control for buildings\.Annual Reviews in Control50,pp\. 190–232\.External Links:ISSN 1367\-5788,[Link](https://www.sciencedirect.com/science/article/pii/S1367578820300584),[Document](https://dx.doi.org/10.1016/j.arcontrol.2020.09.001)Cited by:[§1](https://arxiv.org/html/2609.05822#S1.p2.1)\. - et al\. \(2023\)N\. et al\.Ten questions concerning reinforcement learning for building energy management\.Building and Environment241,pp\. 110435\.External Links:[Document](https://dx.doi.org/10.1016/j.buildenv.2023.110435),[Link](https://www.sciencedirect.com/science/article/pii/S0360132323004626)Cited by:[§1](https://arxiv.org/html/2609.05822#S1.p2.1)\. - et al\. \(2024\)T\. et al\.Domain Randomization via Entropy Maximization\.arXiv\.Note:arXiv:2311\.01885 \[cs\]External Links:[Link](http://arxiv.org/abs/2311.01885),[Document](https://dx.doi.org/10.48550/arXiv.2311.01885)Cited by:[§2\.3](https://arxiv.org/html/2609.05822#S2.SS3.p2.1)\. - \[6\]International Energy AgencyBuildings \- energy system\.Note:IEA websiteAccessed: 2026\-01\-29External Links:[Link](https://www.iea.org/energy-system/buildings)Cited by:[§1](https://arxiv.org/html/2609.05822#S1.p1.1)\. - OpenAI \(2019\)OpenAISolving Rubik’s Cube with a Robot Hand\.arXiv\.Note:arXiv:1910\.07113 \[cs\]External Links:[Link](http://arxiv.org/abs/1910.07113),[Document](https://dx.doi.org/10.48550/arXiv.1910.07113)Cited by:[§2\.3](https://arxiv.org/html/2609.05822#S2.SS3.p2.1)\.
Similar Articles
Contextual Quality-Diversity Evolutionary Reinforcement Learning for HVAC Control in Tropical Commercial Buildings
This paper presents CQD-ERL, a contextual quality-diversity evolutionary reinforcement-learning controller for tropical commercial building HVAC systems, evaluated against an ASHRAE Guideline 36 baseline. It addresses the unique challenges of tropical climates with a safety-shielded, multi-policy archive approach.
From Thermal Preference Prediction to Adaptive Thermal Intervention: A Reinforcement Learning Approach Using Physiological and Environmental Sensing
This paper introduces a two-stage personalized thermal comfort system using reinforcement learning and multimodal sensing to adapt HVAC controls for individual occupant preferences.
When does deep reinforcement learning pay off in HVAC supervisory control? Four small Modelica case studies trained directly on FMUs
该论文通过四个基于Modelica的可复现办公楼案例研究,评估深度强化学习在HVAC监督控制中的实际收益,发现无储能场景下DRL相对良好规则基线的边际极小(0.18%-1.3%),而在储能场景中优势更明显但仍远未达到完美预见最优。
Safe and Generalizable Hierarchical Multi-Agent RL via Constraint Manifold Control
This paper proposes a hierarchical multi-agent reinforcement learning framework that enforces hard safety constraints via a constraint manifold at the low level while enabling effective coordination through high-level policy learning, providing theoretical safety guarantees and achieving near-perfect safety rates with good generalization.
Building2Building: A Large Scale Benchmark for Generalizable Real-World Reinforcement Learning
Introduces Building2Building (B2B), a large-scale benchmark for studying generalization and transfer in reinforcement learning using realistic HVAC control environments built on EnergyPlus, compatible with Gymnasium.