Supervised Reinforcement Learning for the Coordination of Distributed Energy Resources
Summary
This paper proposes a Supervised Reinforcement Learning (SRL) framework for coordinating distributed energy resources, pre-training on demonstration data and fine-tuning with RL to improve sample efficiency and performance.
View Cached Full Text
Cached at: 06/25/26, 05:07 AM
# Supervised Reinforcement Learning for the Coordination of Distributed Energy Resources
Source: [https://arxiv.org/html/2606.24947](https://arxiv.org/html/2606.24947)
\\old@ps@headings
###### Abstract
The increasing integration of distributed energy resources \(DERs\) is crucial for power system decarbonization, yet unlocking DERs’ flexibility is challenged by their inherent uncertainties and modelling complexity\. As traditional optimization methods struggle with such uncertainty and complexity of DERs, reinforcement learning \(RL\) has emerged as a promising alternative for DER management\. However, standard RL methods suffer from sample inefficiency and sub\-optimality when trained from scratch\. Inspired by the training paradigms in large language models, this paper proposes a Supervised Reinforcement Learning \(SRL\) framework for learning DER coordination policies\. This framework first pre\-trains a policy on demonstration data in a supervised\-learning fashion, which is then further fine\-tuned using RL\. Furthermore, we propose a two\-step fine\-tuning process: offline fine\-tuning for enhancing policy performance and online fine\-tuning for adapting it to the real\-world dynamics\. Experiments demonstrate that RL implementations based on the proposed framework significantly outperform all benchmarks, achieving high cost efficiency even under low\-quality demonstration data\.
\\thanksto
The work was supported in part by the National Natural Science Foundation of China \(U25B6016\), in part by the Research Grants Council of the Hong Kong SAR \(HKU 17201225\), in part by Advanced Research \+ Invention Agency \(ARIA\) under Project SAGEflex: Safeguarded AI Agents for Grid\-Edge Flexibility, and in part by Engineering and Physical Sciences Research Council \(EPSRC\) under Project FleXEdge: Data\-Driven Cloud\-to\-Edge Computing for Scalable Near Real\-Time Local Flexibility Markets\.
## IIntroduction
The global power system decarbonization is pushing a higher integration of distributed energy resources \(DERs\), such as distributed renewables, energy storage \(ES\), and thermostatically controlled loads \(TCLs\)\. These DERs have valuable power flexibility, which is equivalent to that provided by multiple large power plants, with their global value estimated at USD $270 billion by 2040\[[21](https://arxiv.org/html/2606.24947#bib.bib1)\]\. However, the inherent uncertainties of DERs and their modelling complexity represent a significant challenge in unlocking their flexibility\[[26](https://arxiv.org/html/2606.24947#bib.bib3)\]\. Accurate DER modeling tends to be nonlinear and nonconvex\. For example, the charging/discharging efficiency of ESS is observed to have a nonlinear nonconvex relationship to the charging/discharging power\[[3](https://arxiv.org/html/2606.24947#bib.bib4)\], and the accurate TCL model is a set of differential equations\[[22](https://arxiv.org/html/2606.24947#bib.bib6)\]\. For computational tractability, traditional optimization methods often use convex or even linear approximations of these DER models, which can lead to suboptimal results in real\-world operations\. Reinforcement learning \(RL\) has emerged as a promising alternative that could learn to adapt to complex non\-convex environments\[[25](https://arxiv.org/html/2606.24947#bib.bib5)\]\. Initial attempts leverage traditional Q\-learning for tasks like smart charging of electric vehicles\[[4](https://arxiv.org/html/2606.24947#bib.bib18)\]and flexible load management\[[13](https://arxiv.org/html/2606.24947#bib.bib19),[15](https://arxiv.org/html/2606.24947#bib.bib20)\], but are constrained by their inability to operate in continuous action spaces\. Consequently, the focus has shifted towards more advanced policy\-based algorithms, for instance, the application of Deep Deterministic Policy Gradient \(DDPG\) for smart home energy management\[[24](https://arxiv.org/html/2606.24947#bib.bib21)\], Proximal Policy Optimization \(PPO\) for microgrid energy management\[[23](https://arxiv.org/html/2606.24947#bib.bib22)\], and Soft Actor\-Critic \(SAC\) for the optimal dispatch of wind\-storage systems\[[11](https://arxiv.org/html/2606.24947#bib.bib23)\]\. However, most of the above studies employ standard RL algorithms trained from scratch, without a deep investigation into their intrinsic limitations, such as poor sample efficiency and the sub\-optimality of the learned policy\. Specifically, the difficulty and instability associated with training agents from scratch for complex systems present a major barrier to their real\-world adoption\.
The success of reinforcement learning from human feedback \(RLHF\)\[[10](https://arxiv.org/html/2606.24947#bib.bib10)\]in large language models \(LLMs\) provides valuable insights for DERs control\. Standard LLM training follows the “supervised pre\-training plus RL fine\-tuning” paradigm, which consists of two stages: 1\) pre\-training through \(self\-\)supervised learning, followed by 2\) RLHF for fine\-tuning\[[1](https://arxiv.org/html/2606.24947#bib.bib11)\]\. This paradigm shift—using RL for fine\-tuning rather than training from scratch—has been crucial for its successful real\-world applications\. The DERs’ control problem shares key characteristics similar to LLM: both use RL for complicated problems with substantial data available for pre\-training \(there are sufficient historical DER operation experiences, though non\-/sub\-optimal or rule\-based\)\. This motivates us to migrate the two\-stage paradigm of LLM training to DER control problems\.
Some existing work has attempted to utilize demonstration data to train a DER control policy\. Ref\.\[[6](https://arxiv.org/html/2606.24947#bib.bib24)\]develops a multi\-agent imitation learning \(IL\) framework where individual agents are trained to emulate the optimal control actions of an optimization solver for managing multiple energy storage systems in a microgrid\. Ref\.\[[5](https://arxiv.org/html/2606.24947#bib.bib25)\]proposes an IL\-based approach that mimics an MILP solver for the economic dispatch of a microgrid\. However, these studies are confined to supervised imitation and overlook the performance gains achievable through subsequent fine\-tuning based on the interactive environment\. Moreover, some work has tried to use historical DER operation data to enhance the performance of RL algorithms\. For instance, Ref\.\[[2](https://arxiv.org/html/2606.24947#bib.bib8)\]conducts offline convex optimizations on historical data, assuming perfect knowledge of all variables, to generate expert demonstrations for initializing the replay buffer\. In contrast, rather than preparing demonstration data in a single batch, Ref\.\[[12](https://arxiv.org/html/2606.24947#bib.bib7)\]establishes a continuous expert data flow by employing an optimizer to iteratively refine the trajectories collected by the RL agent\. However, these studies primarily relies on offline RL methods, where prior data is simply stored in a replay buffer to facilitate training from scratch\.
Recent work has also explored multi\-step training frameworks to enhance agents’ performance for online deployment\. For example, Ref\.\[[17](https://arxiv.org/html/2606.24947#bib.bib26)\]proposes a two\-stage method that first trains a calibrated and conservative value function from offline data and then fine\-tunes the policy online to avoid performance degradation\. Ref\.\[[20](https://arxiv.org/html/2606.24947#bib.bib27)\]introduces an intermediate online training phase to train a new online value function, which then acts jointly with the frozen offline value function to refine the policy network\. However, these studies focus on improving the estimation of value functions while overlooking the quality issues of the offline dataset\. Suboptimal data can corrupt the value functions, causing the policy to overvalue inferior behaviors from the dataset and degrade the policy’s adaptability to the online environment\. Furthermore, these studies do not consider refining the policy in a high\-fidelity simulated environment before online fine\-tuning, a critical step for a smooth transition to the real\-world environment with complex and stochastic dynamics\.
Fundamentally, current methods do not follow the “supervised pre\-training plus RL fine\-tuning” paradigm of using prior data for pre\-training and RL for fine\-tuning\. Given the success in LLM and the similarity in DER control problems, migrating the two\-stage paradigm to DER control may lead to extra performance gain\. Therefore, this work proposes the Supervised Reinforcement Learning \(SRL\) framework for DER control problems, involving: 1\) a supervised pre\-training stage for achieving baseline operational performance; 2\) an RL\-based fine\-tuning stage for enhancing performance\. This paper makes the following contributions:
1. 1\.Motivated by the success in the current LLM training paradigm, we propose a SRL framework that combines supervised pre\-training and RL\-based fine\-tuning for DER control problems\. Specifically, a policy is pre\-trained on demonstrations and then fine\-tuned with RL methods\. The proposed framework can effectively enhance the performance of the DER control policy\.
2. 2\.For the RL\-based fine\-tuning stage, we propose a two\-step fine\-tuning method, which involves an offline fine\-tuning step in a simulated environment and an online fine\-tuning step in the actual environment\. This further improves the optimality of the control policy and provides a higher starting performance in the real environment\.
3. 3\.We performed comprehensive numerical experiments to validate the effectiveness and superiority of our proposed framework\. Specifically, we evaluated its performance with varying quality of the pre\-training demonstration data\. Results show that performance improvement can be attained even with low\-quality demonstration data\.
The rest of the paper is organized as follows: Section[II](https://arxiv.org/html/2606.24947#S2)introduces the problem to be solved and the corresponding formulated Markov Decision Process \(MDP\)\. Section[III](https://arxiv.org/html/2606.24947#S3)presents the proposed SRL framework\. Section[IV](https://arxiv.org/html/2606.24947#S4)conducts case studies, while Section[V](https://arxiv.org/html/2606.24947#S5)concludes the paper\.
## IIProblem Formulation
We consider an optimal energy management problem of a microgrid connected to an external grid\. This microgrid integrates a heterogeneous collection of DERs, including photovoltaic \(PV\) panels, wind turbines \(WTs\), diesel generators \(DGs\), thermostatically controlled loads \(TCLs\), and energy storages \(ESs\)\. We assume a centralized control setting where a single controller governs the operation of all DERs\. The main objective is to minimize the operation cost while satisfying the supply\-demand balance\.
This section first presents a complete and accurate mathematical modelling of the microgrid control problem\. Subsequently, this problem is approximated as a Markov Decision Process \(MDP\) for the application of the RL paradigm\.
### II\-AAccurate Mathematical Model
The objective of DER control in the microgrid is to minimize the overall operational cost:
min∑t∈T\(λbuy,tPbuy,t\+λsell,tPsell,t\+∑g∈𝒢cg,tPg,t\),\\min\\sum\_\{t\\in T\}\\Big\(\\lambda\_\{\\text\{buy\},t\}P\_\{\\text\{buy\},t\}\+\\lambda\_\{\\text\{sell\},t\}P\_\{\\text\{sell\},t\}\+\\sum\_\{g\\in\\mathcal\{G\}\}c\_\{g,t\}P\_\{g,t\}\\Big\),\(1\)whereλbuy,t\\lambda\_\{\\text\{buy\},t\}andλsell,t\\lambda\_\{\\text\{sell\},t\}are the price of buying/selling energy from/to the external grid;Pbuy,tP\_\{\\text\{buy\},t\}andPsell,tP\_\{\\text\{sell\},t\}are the amount of energy that trade with the external grid;Pg,tP\_\{g,t\}is the amount of energy generated by generatorggandcg,tc\_\{g,t\}is the corresponding generation cost \(we assume a linear cost model\)\. This paper focuses on accurate \(nonlinear\) DER operational models\. The battery degradation cost and the wear\-and\-tear cost of TCLs are not considered for simplicity, but are straightforward to include\.
The first set of constraints in the microgrid DER operation is the power balance:
∑g∈𝒢,𝒲,𝒫Pg,t\+∑m∈ℬPm,tdis\+PtUPG=PtD\+∑l∈ℋPl,t\+∑m∈ℬPm,tch,∀t∈T,\\begin\{split\}&\\sum\_\{g\\in\\mathcal\{G\},\\mathcal\{W\},\\mathcal\{P\}\}\{P\_\{g,t\}\}\+\\sum\_\{m\\in\\mathcal\{B\}\}P^\{\\text\{dis\}\}\_\{m,t\}\+P^\{\\text\{UPG\}\}\_\{t\}=P^\{D\}\_\{t\}\+\\sum\_\{l\\in\\mathcal\{H\}\}P\_\{l,t\}\+\\sum\_\{m\\in\\mathcal\{B\}\}P^\{\\text\{ch\}\}\_\{m,t\},\\\\ &\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\quad\\forall t\\in T,\\end\{split\}\(2\)PtUPG=Pbuy,t−Psell,t,∀t∈T,P^\{\\text\{UPG\}\}\_\{t\}=P\_\{\\text\{buy\},t\}\-P\_\{\\text\{sell\},t\},\\forall t\\in T,\(3\)wherePm,tdis/chP^\{\\text\{dis\}/\\text\{ch\}\}\_\{m,t\}denotes the discharging/charging power of ESmm;PtUPGP^\{\\text\{UPG\}\}\_\{t\}is the power traded with the external grid;PtDP^\{D\}\_\{t\}is local electricity demand of the microgrid;Pl,tP\_\{l,t\}is the power demand of TCLll;𝒢\\mathcal\{G\}represent the sets of DGs;𝒲\\mathcal\{W\}represent the sets of WTs;𝒫\\mathcal\{P\}represent the sets of PVs;ℋ\\mathcal\{H\}represent the sets of TCLs; andℬ\\mathcal\{B\}represent the sets of ESs\.
The accurate DER operation models represent the other part of the constraints of the microgrid DER operation problem:
#### II\-A1Distributed Energy Generator
The distributed energy generators, including DGs, PVs, and WTs, can be modelled as:
P¯g≤Pg,t≤P¯g,∀g∈𝒢∪𝒲∪𝒫,∀t∈T,\\underline\{P\}\_\{g\}\\leq P\_\{g,t\}\\leq\\overline\{P\}\_\{g\},\\forall g\\in\\mathcal\{G\}\\cup\\mathcal\{W\}\\cup\\mathcal\{P\},\\forall t\\in T,\(4\)whereP¯g\\underline\{P\}\_\{g\}andP¯g\\overline\{P\}\_\{g\}are upper and lower boundaries for the output of generatorgg\.
#### II\-A2Energy Storage
An ES can be modelled as:
Sm,t\+1=Sm,t\+Pm,tchΔtηmchEm−Pm,tdisΔtηmdisEm,∀m∈ℬ,∀t∈T,\\begin\{split\}&S\_\{m,t\+1\}=S\_\{m,t\}\+\\frac\{P^\{\\text\{ch\}\}\_\{m,t\}\\Delta\{t\}\\eta^\{\\text\{ch\}\}\_\{m\}\}\{E\_\{m\}\}\-\\frac\{P^\{\\text\{dis\}\}\_\{m,t\}\\Delta\{t\}\}\{\\eta^\{\\text\{dis\}\}\_\{m\}E\_\{m\}\},\\\\ &\\qquad\\qquad\\qquad\\qquad\\qquad\\forall m\\in\\mathcal\{B\},\\forall t\\in T,\\end\{split\}\(5\)S¯m≤Sm,t≤S¯m,∀m∈ℬ,∀t∈T,\\underline\{S\}\_\{m\}\\leq S\_\{m,t\}\\leq\\overline\{S\}\_\{m\},\\forall m\\in\\mathcal\{B\},\\forall t\\in T,\(6\)0≤Pm,tch≤P¯mℐm,t,∀m∈ℬ,∀t∈T,0\\leq P^\{\\text\{ch\}\}\_\{m,t\}\\leq\\overline\{P\}\_\{m\}\\mathcal\{I\}\_\{m,t\},\\forall m\\in\\mathcal\{B\},\\forall t\\in T,\(7\)
0≤Pm,tdis≤P¯m\(1−ℐm,t\),∀m∈ℬ,∀t∈T,0\\leq P^\{\\text\{dis\}\}\_\{m,t\}\\leq\\overline\{P\}\_\{m\}\\left\(1\-\\mathcal\{I\}\_\{m,t\}\\right\),\\forall m\\in\\mathcal\{B\},\\forall t\\in T,\(8\)where Eq\. \([5](https://arxiv.org/html/2606.24947#S2.E5)\) represents the State of Charge \(SoC\) dynamics of an ES with energy capacityEmesE^\{\\text\{es\}\}\_\{m\}, considering the charging efficiencyηmesc\\eta^\{\\text\{esc\}\}\_\{m\}and discharging efficiencyηmesd\\eta^\{\\text\{esd\}\}\_\{m\}\. Eq\. \([6](https://arxiv.org/html/2606.24947#S2.E6)\) indicates the limited boundary for ESs’ SoC\. Eq\. \([7](https://arxiv.org/html/2606.24947#S2.E7)\) and \([8](https://arxiv.org/html/2606.24947#S2.E8)\) demonstrate the upper and lower bounds of charging and discharging power with a binary variableℐm,t\\mathcal\{I\}\_\{m,t\}distinguishing the status of the ES between charging \(ℐm,t=1\\mathcal\{I\}\_\{m,t\}=1\) and discharging \(ℐm,t=0\\mathcal\{I\}\_\{m,t\}=0\)\.
Although the charging/discharging efficiency is usually assumed to be constant in the conventional ES model, the efficiency is actually a nonlinear function of SoC and charging/discharging power\[[3](https://arxiv.org/html/2606.24947#bib.bib4)\]\. To account for the nonlinear relationship among charging efficiency, SoC, and charging power, we adopt the steady state equivalent circuit model proposed in\[[16](https://arxiv.org/html/2606.24947#bib.bib12)\], in which the circuit parameters of ESmmcan be formulated as:
Vmoc=a0e\(−a1Sm\)\+a2\+a3Sm−a4Sm2\+a5Sm3,V^\{\\text\{oc\}\}\_\{m\}=a\_\{0\}e^\{\\left\(\-a\_\{1\}S\_\{m\}\\right\)\}\+a\_\{2\}\+a\_\{3\}S\_\{m\}\-a\_\{4\}S\_\{m\}^\{2\}\+a\_\{5\}S\_\{m\}^\{3\},\(9\)Rms=b0e\(−b1Sm\)\+b2\+b3Sm−b4Sm2\+b5Sm3,R^\{s\}\_\{m\}=b\_\{0\}e^\{\\left\(\-b\_\{1\}S\_\{m\}\\right\)\}\+b\_\{2\}\+b\_\{3\}S\_\{m\}\-b\_\{4\}S\_\{m\}^\{2\}\+b\_\{5\}S\_\{m\}^\{3\},\(10\)Rmts=c0⋅e−c1⋅Sm\+c2,R^\{\\text\{ts\}\}\_\{m\}=c\_\{0\}\\cdot e^\{\-c\_\{1\}\\cdot S\_\{m\}\}\+c\_\{2\},\(11\)Rmtl=d0⋅e−d1⋅Sm\+d2,R^\{\\text\{tl\}\}\_\{m\}=d\_\{0\}\\cdot e^\{\-d\_\{1\}\\cdot S\_\{m\}\}\+d\_\{2\},\(12\)whereVmocV^\{\\text\{oc\}\}\_\{m\}is open circuit voltage;RmsR^\{s\}\_\{m\}is the series resistance that used to characterize the charge/discharge energy losses;RmtsR^\{\\text\{ts\}\}\_\{m\}andRmtlR^\{\\text\{tl\}\}\_\{m\}are resistances used to characterize the short\-term and long\-term transient responses of the ES\.
For a particular SoC and output power, the circuit current can be obtained by solving the quadratic equationPme=Im\[Vmoc−\(Rms\+Rmts\+Rmtl\)Im\]P^\{e\}\_\{m\}=I\_\{m\}\\left\[V^\{\\text\{oc\}\}\_\{m\}\-\\left\(R^\{s\}\_\{m\}\+R^\{\\text\{ts\}\}\_\{m\}\+R^\{\\text\{tl\}\}\_\{m\}\\right\)I\_\{m\}\\right\]\.
Im=Vmoc−\(Vmoc\)2−4⋅\(Rms\+Rmts\+Rmtl\)⋅Pmch/dis2⋅\(Rms\+Rmts\+Rmtl\),I\_\{m\}=\\frac\{V^\{\\text\{oc\}\}\_\{m\}\-\\sqrt\{\\left\(V^\{\\text\{oc\}\}\_\{m\}\\right\)^\{2\}\-4\\cdot\\left\(R^\{s\}\_\{m\}\+R^\{\\text\{ts\}\}\_\{m\}\+R^\{\\text\{tl\}\}\_\{m\}\\right\)\\cdot P^\{\\text\{ch\}/\\text\{dis\}\}\_\{m\}\}\}\{2\\cdot\\left\(R^\{s\}\_\{m\}\+R^\{\\text\{ts\}\}\_\{m\}\+R^\{\\text\{tl\}\}\_\{m\}\\right\)\},\(13\)whereImI\_\{m\}is the circuit current\.
Subsequently, the charging and discharging efficiency of the ES is given by:
ηmch=VmocVmoc−\(Rms\+Rmts\+Rmtl\)⋅Im,\\eta^\{\\text\{ch\}\}\_\{m\}=\\frac\{V^\{\\text\{oc\}\}\_\{m\}\}\{V^\{\\text\{oc\}\}\_\{m\}\-\\left\(R^\{s\}\_\{m\}\+R^\{\\text\{ts\}\}\_\{m\}\+R^\{\\text\{tl\}\}\_\{m\}\\right\)\\cdot I\_\{m\}\},\(14\)ηmdis=Vmoc−\(Rms\+Rmts\+Rmtl\)⋅ImVmoc\.\\eta^\{\\text\{dis\}\}\_\{m\}=\\frac\{V^\{\\text\{oc\}\}\_\{m\}\-\\left\(R^\{s\}\_\{m\}\+R^\{\\text\{ts\}\}\_\{m\}\+R^\{\\text\{tl\}\}\_\{m\}\\right\)\\cdot I\_\{m\}\}\{V^\{\\text\{oc\}\}\_\{m\}\}\.\(15\)
#### II\-A3Thermostatically Controlled Load
The operation and the temperature evolution of a TCL are modeled through the following first\-order differentiation equations\[[8](https://arxiv.org/html/2606.24947#bib.bib13)\]:
0≤Pl,t≤P¯l,∀l∈ℋ,∀t∈T,0\\leq P\_\{l,t\}\\leq\\overline\{P\}\_\{l\},\\forall l\\in\\mathcal\{H\},\\ \\forall t\\in T,\(16\)θ˙t=−1RthCth\(θt−θta\)−𝜿CthPl,t,∀l∈ℋ,∀t∈T,\\begin\{split\}&\\dot\{\\theta\}\_\{t\}=\-\\frac\{1\}\{R\_\{\\text\{th\}\}C\_\{\\text\{th\}\}\}\\left\(\\theta\_\{t\}\-\\theta^\{a\}\_\{t\}\\right\)\-\\frac\{\\boldsymbol\{\\kappa\}\}\{C\_\{\\text\{th\}\}\}P\_\{l,t\},\\ \\forall l\\in\\mathcal\{H\},\\forall t\\in T,\\end\{split\}\(17\)θt∈\[θset−Δθ,θset\+Δθ\]\\theta\_\{t\}\\in\[\\theta^\{\\text\{set\}\}\-\\Delta\\theta,\\theta^\{\\text\{set\}\}\+\\Delta\\theta\]\(18\)whereP¯l\\overline\{P\}\_\{l\}is rated power of TCLll;θt\\theta\_\{t\},θta\\theta^\{a\}\_\{t\}, andθ˙t\\dot\{\\theta\}\_\{t\}are the indoor temperature, ambient temperature, temperature set\-point, and change of temperature, respectively;RthR\_\{\\text\{th\}\},CthC\_\{\\text\{th\}\}, and𝜿\\boldsymbol\{\\kappa\}are thermal resistance, thermal capacitance, and coefficient of performance;θset\\theta^\{\\text\{set\}\}is the temperature set\-point and\[θset−Δθ,θset\+Δθ\]\[\\theta^\{\\text\{set\}\}\-\\Delta\\theta,\\theta^\{\\text\{set\}\}\+\\Delta\\theta\]represents the confort zone\.
It is worth noting that the proposed framework does not depend on specific DER operation models\. SRL, as a model\-free method, is readily compatible with non\-differentiable or even black\-box models, such as any battery vendor simulators\. The accurate modeling presented in this subsection is primarily for constructing a high\-fidelity simulation environment for validation, aiming to approximate the real\-world environment\.
### II\-BMDP Formulation of DER Operation
To facilitate the use of RL, we can approximate the DER operation problem as an MDP, which is characterized by a tuple⟨𝒮,𝒜,𝒫,r,γ⟩\\left<\\mathcal\{S\},\\mathcal\{A\},\\mathcal\{P\},r,\\gamma\\right\>, where𝒮\\mathcal\{S\}is the state space;𝒜\\mathcal\{A\}is the action space;𝒫\(s′\|s,a\):𝒮×𝒜×𝒮→ℝ\\mathcal\{P\}\\left\(s^\{\\prime\}\\lvert s,a\\right\):\\mathcal\{S\}\\times\\mathcal\{A\}\\times\\mathcal\{S\}\\rightarrow\\mathbb\{R\}is the probability of state transition;r:𝒮×𝒜→ℝr:\\mathcal\{S\}\\times\\mathcal\{A\}\\rightarrow\\mathbb\{R\}is the reward function;γ∈\[0,1\]\\gamma\\in\[0,1\]is the discount factor for future reward\.
#### II\-B1State
The state space at timettcan be defined as:
𝐬t=\[𝐒t,𝐏tpv,𝐏twt,𝐓tin,𝐓ta,PtD,λbuy,tp,λsell,tp,t\],\\mathbf\{s\}\_\{t\}=\[\\mathbf\{S\}\_\{t\},\\mathbf\{P\}^\{\\text\{pv\}\}\_\{t\},\\mathbf\{P\}^\{\\text\{wt\}\}\_\{t\},\\mathbf\{T\}^\{\\text\{in\}\}\_\{t\},\\mathbf\{T\}^\{a\}\_\{t\},P^\{D\}\_\{t\},\\lambda^\{p\}\_\{\\text\{buy\},t\},\\lambda^\{p\}\_\{\\text\{sell\},t\},t\],\(19\)where𝐒t\\mathbf\{S\}\_\{t\}is the SoC of ESs;𝐏tpv\\mathbf\{P\}^\{\\text\{pv\}\}\_\{t\}and𝐏twt\\mathbf\{P\}^\{\\text\{wt\}\}\_\{t\}are renewable energy output;𝐓tin\\mathbf\{T\}^\{\\text\{in\}\}\_\{t\}is indoor temperature of the TCL;𝐓ta\\mathbf\{T\}^\{a\}\_\{t\}is the ambient temperature;λbuy,tp\\lambda^\{p\}\_\{\\text\{buy\},t\}andλsell,tp\\lambda^\{p\}\_\{\\text\{sell\},t\}are the buying and selling prices of energy from the external grid at the current time step\.
#### II\-B2Action
The action space at timettis defined as:
𝐚t=\[𝒂tdg,𝒂tes,𝒂ttcl\],\\mathbf\{a\}\_\{t\}=\[\\boldsymbol\{a\}^\{\\text\{dg\}\}\_\{t\},\\boldsymbol\{a\}^\{\\text\{es\}\}\_\{t\},\\boldsymbol\{a\}^\{\\text\{tcl\}\}\_\{t\}\],\(20\)where𝒂tdg\\boldsymbol\{a\}^\{\\text\{dg\}\}\_\{t\}and𝒂tes\\boldsymbol\{a\}^\{\\text\{es\}\}\_\{t\}are the energy output rate for DGs and ESs; and𝒂ttcl\\boldsymbol\{a\}^\{\\text\{tcl\}\}\_\{t\}is the energy input rate of TCL\. It should be noted that the actions for DG and TCL are normalized rates within\[0,1\]\[0,1\], and the action for ES is a charge/discharge rate within\[−1,1\]\[\-1,1\]\. The actual power output is obtained by scaling these actions with the device’s maximum power capacity, thus inherently guaranteeing compliance with physical limits\.
#### II\-B3State Transition
The state transition from𝐬t\\mathbf\{s\}\_\{t\}to𝐬t\+1\\mathbf\{s\}\_\{t\+1\}is characterized by both deterministic and stochastic elements\. We can decompose the state vector𝐬t\\mathbf\{s\}\_\{t\}into two components: endogenous states, which are directly controllable, and exogenous states, which are influenced by the external environment\. The endogenous components, such as the SoC of ESs𝐒t\\mathbf\{S\}\_\{t\}and TCL indoor temperatures𝐓tin\\mathbf\{T\}^\{\\text\{in\}\}\_\{t\}, follow a deterministic transition function dependent on the current state and the applied action𝐚t\\mathbf\{a\}\_\{t\}\. Conversely, the exogenous components, representing renewable generation, energy prices, and ambient conditions, evolve stochastically, driven by unobservable environmental randomness\.
#### II\-B4Reward
The reward functionrtr\_\{t\}is formulated as the negative of the total operational cost\. To this end, the agent can learn a policy that minimizes long\-term costs by maximizing the expected cumulative reward\.
rt=−\(λbuy,tPbuy,t\+λsell,tPsell,t\+∑g∈𝒢cg,tPg,t\)\.r\_\{t\}=\-\\Big\(\\lambda\_\{\\text\{buy\},t\}P\_\{\\text\{buy\},t\}\+\\lambda\_\{\\text\{sell\},t\}P\_\{\\text\{sell\},t\}\+\\sum\_\{g\\in\\mathcal\{G\}\}c\_\{g,t\}P\_\{g,t\}\\Big\)\.\(21\)
## IIIMethodology
Figure 1:Schematic of the proposed SRL framework\.The proposed SRL framework for DER control is depicted in Fig\.[1](https://arxiv.org/html/2606.24947#S3.F1)\. The framework begins with a supervised pre\-training stage to establish a pre\-trained policy that realizes a baseline level of operational performance\. This is followed by a fine\-tuning stage, where the policy is further refined to improve its efficacy and adapt to the real\-world environment\.
### III\-ASupervised Pre\-training From Demonstrations
The supervised pre\-training stage serves as a crucial foundation for our framework, motivated by the need to enhance sample efficiency and ensure an improved starting point for learning\. Drawing inspiration from the two\-stage paradigm of LLM training, this stage leverages demonstration data to initialize the control policy with a competent behavioral prior\. To be more specific, we pre\-train a policyμ\\mubased on the demonstration dataset𝒟˙\\dot\{\\mathcal\{D\}\}with previously collected data in a supervised learning manner\. Such prior data may come either from look\-back optimization problems based on historical information or from human expert operations used in real production environments\. The loss function of the pre\-training stage can be the standard squared loss in supervised regression tasks:
L\(𝜽\)=𝔼\(𝒔,𝒂\)∼𝒟˙\[12\(μ\(𝒔;𝜽\)−𝒂\)2\],L\(\\boldsymbol\{\\theta\}\)=\\mathbb\{E\}\_\{\(\\boldsymbol\{s\},\\boldsymbol\{a\}\)\\sim\\dot\{\\mathcal\{D\}\}\}\\left\[\\frac\{1\}\{2\}\\left\(\\mu\(\\boldsymbol\{s\};\\boldsymbol\{\\theta\}\)\-\\boldsymbol\{a\}\\right\)^\{2\}\\right\],\(22\)where𝜽\\boldsymbol\{\\theta\}is the parameter of the policy,\(𝒔,𝒂\)\(\\boldsymbol\{s\},\\boldsymbol\{a\}\)denotes state\-action pairs that are previously collected\. By minimizing the error between the demonstration action and the policy output under a certain state, the agent learns to predict the most probable action corresponding to a given state\.
This supervised pre\-training stage avoids the critical disadvantage of traditional RL, which often starts from scratch and relies on inefficient, random exploration that can be slow and unstable\. Instead of exploring blindly, our pre\-trained agent begins its reinforcement learning process with an inherent understanding of competent behavior, enabling it to generate meaningful and effective transitions from the outset\. This “warm start” not only dramatically improves sample efficiency but also provides a solid foundation for the subsequent fine\-tuning stage\.
### III\-BTwo\-step Fine\-tuning
Figure 2:The SRL framework with two\-step fine\-tuning\.The motivation for adopting the fine\-tuning procedure stems from the inherent limitations of a policy derived purely from supervised learning\. While pre\-training establishes a competent baseline, the policy is essentially a static imitation of the demonstration dataset; i\.e\., the policy learned by minimizing the MSE loss does not necessarily lead to the lowest operational cost \(highest reward\)\. Therefore, a fine\-tuning stage is required to allow the agent to adapt to the environment’s dynamics and refine its strategy based on the received reward signal, thereby improving its performance on the control task\.
However, deploying the pre\-trained policy directly into a real\-world environment with its complex and stochastic dynamics poses a significant risk of the agent converging to a suboptimal solution\. To mitigate the aforementioned risk and systematically bridge the policy from imitation to optimization, we split the fine\-tuning stage into two steps: offline fine\-tuning in the simulated environment and online fine\-tuning in the actual environment, as shown in Fig\.[2](https://arxiv.org/html/2606.24947#S3.F2)\. Through offline fine\-tuning in the simulated environment, the agent can cultivate a preliminary decision\-making logic oriented towards maximizing long\-term rewards\. Then, the online fine\-tuning step has a distinct and focused objective: closing the ‘sim\-to\-real’ gap\. This final step adapts the well\-prepared policy to the unmodeled dynamics of the real\-world physical system, ensuring truly optimal and adaptive performance in the actual operational environment\.
A simulated environment resembles the actual complex environment, but with some approximation error\. To model this approximation error, when creating the simulated environment we perform piecewise linearization to approximate the actual nonlinear dependency of ES efficiency on the SOC and charging/discharging power\. Specifically, a fixed efficiency value is assigned to each discretized bin of SOC and ES power, indexed byiiandjj:
ηmch/dis\(Sm,Pmch/dis\)=ηi,jch/dis,∀Sm∈\[SOCi,SOCi\+1\],Pmch/dis∈\[Pj,Pj\+1\]\.\\begin\{split\}&\\eta^\{\\text\{ch\}/\\text\{dis\}\}\_\{m\}\(S\_\{m\},P^\{\\text\{ch\}/\\text\{dis\}\}\_\{m\}\)=\\eta^\{\\text\{ch\}/\\text\{dis\}\}\_\{i,j\},\\\\ &\\forall S\_\{m\}\\in\\left\[SOC\_\{i\},SOC\_\{i\+1\}\\right\],P^\{\\text\{ch\}/\\text\{dis\}\}\_\{m\}\\in\\left\[P\_\{j\},P\_\{j\+1\}\\right\]\.\\end\{split\}\(23\)
As for the differential process of temperature evolution, the continuous linear differential process governing temperature evolution is discretized using a forward Euler method\. Specifically, the differential Eq\. \([17](https://arxiv.org/html/2606.24947#S2.E17)\) is transformed into a discrete\-time difference equation using a fixed time stepΔt\\Delta t:
θk\+1=θk−Δt\[1RthCth\(θk−θka\)\+𝜿CthPl,k\]\.\\begin\{split\}&\\theta\_\{k\+1\}=\\theta\_\{k\}\-\\Delta t\\left\[\\frac\{1\}\{R\_\{\\text\{th\}\}C\_\{\\text\{th\}\}\}\\left\(\\theta\_\{k\}\-\\theta^\{a\}\_\{k\}\\right\)\+\\frac\{\\boldsymbol\{\\kappa\}\}\{C\_\{\\text\{th\}\}\}P\_\{l,k\}\\right\]\.\\end\{split\}\(24\)
It should be noted that our proposed framework is designed to be compatible with a wide range of policy\-based RL methods\. For our implementation, we selected Proximal Policy Optimization \(PPO\)\[[19](https://arxiv.org/html/2606.24947#bib.bib14)\]as the foundational algorithm, primarily due to its renowned stability and consistent performance\.
### III\-CFull Algorithm
Algorithm 1Supervised Reinforcement Learning1:Initialize policy network
π𝜽\\pi\_\{\\boldsymbol\{\\theta\}\}and replay buffer
𝒟←∅\\mathcal\{D\}\\leftarrow\\emptyset
2:Collect demonstration data for supervised pre\-training
3:forepisode
s=1s=1to
E1E\_\{1\}do
4:Update policy weights
𝜽\\boldsymbol\{\\theta\}according to Eq\. \([22](https://arxiv.org/html/2606.24947#S3.E22)\)
5:endfor
6:Create simulated environment according to Eqs\. \([23](https://arxiv.org/html/2606.24947#S3.E23)\) and \([24](https://arxiv.org/html/2606.24947#S3.E24)\) for offline fine\-tuning
7:forepisode
s=1s=1to
E2E\_\{2\}do
8:Sample action
𝐚t\\mathbf\{a\}\_\{t\}according to
π𝜽\\pi\_\{\\boldsymbol\{\\theta\}\}
9:Observe the next state
𝐬t\+1\\mathbf\{s\}\_\{t\+1\}and reward
rtr\_\{t\}
10:Store transition
\{𝐬t,𝐚t,𝐬t\+1,rt\}\\\{\\mathbf\{s\}\_\{t\},\\mathbf\{a\}\_\{t\},\\mathbf\{s\}\_\{t\+1\},r\_\{t\}\\\}to the replay buffer
𝒟\\mathcal\{D\}
11:Sample a batch of experience from the replay buffer
𝒟\\mathcal\{D\}
12:Update policy weights
𝜽\\boldsymbol\{\\theta\}based on the PPO paradigm
13:endfor
14:Initialize replay buffer
𝒟←∅\\mathcal\{D\}\\leftarrow\\emptysetand prepare real\-world environment for online fine\-tuning
15:forepisode
s=1s=1to
E3E\_\{3\}do
16:Sample action
𝐚t\\mathbf\{a\}\_\{t\}according to
π𝜽\\pi\_\{\\boldsymbol\{\\theta\}\}
17:Observe the next state
𝐬t\+1\\mathbf\{s\}\_\{t\+1\}and reward
rtr\_\{t\}
18:Store transition
\{𝐬t,𝐚t,𝐬t\+1,rt\}\\\{\\mathbf\{s\}\_\{t\},\\mathbf\{a\}\_\{t\},\\mathbf\{s\}\_\{t\+1\},r\_\{t\}\\\}to the replay buffer
𝒟\\mathcal\{D\}
19:Sample a batch of experience from the replay buffer
𝒟\\mathcal\{D\}
20:Update policy weights
𝜽\\boldsymbol\{\\theta\}based on the PPO paradigm
21:endfor
The complete procedure of the proposed SRL framework is detailed in Algorithm[1](https://arxiv.org/html/2606.24947#alg1)\. The algorithm is structured into two principal stages: a supervised pre\-training stage to establish a baseline policy, followed by a two\-step fine\-tuning stage encompassing both offline and online refinement to enhance performance and real\-world adaptability\.
The algorithm commences with supervised pre\-training \(Lines 1\-5\), where the policy is trained on a demonstration dataset by minimizing the loss function Eq\. \([22](https://arxiv.org/html/2606.24947#S3.E22)\)\. This stage establishes a behavioral prior before any environmental interaction, which is followed by offline fine\-tuning \(Lines 6\-13\) in a simulated environment\. The policy is further refined through interaction, using the PPO algorithm to update its weights\. The final step is online fine\-tuning \(Lines 14\-21\)\. Here, the refined policy is deployed in the actual environment to bridge the sim\-to\-real gap\.
## IVCase Studies
### IV\-AExperiment Setups
For the DERs control problem, we consider 1 PV, 1 WT, 1 DG, 1 ES, and 1 TCL\. The operational data of power demand and renewable energy generation are sourced from the UK Nation Grid\[[18](https://arxiv.org/html/2606.24947#bib.bib15)\]\. The ambient temperature data is obtained from\[[7](https://arxiv.org/html/2606.24947#bib.bib16)\]\. In this work, we adopt a time\-of\-use \(TOU\) electricity pricing scheme modified from\[[14](https://arxiv.org/html/2606.24947#bib.bib28)\], with details presented in Table[I](https://arxiv.org/html/2606.24947#S4.T1)\. The price of selling power is set to 50% of the buying price\. The DG cost coefficientcg,tc\_\{g,t\}is set to 0\.2 £/kWh\. The initial SoC of ESs is set to be 0\. The constructed dataset spans a continuous period of five months\. For our proposed framework, we allocate the first month as the pre\-training set, the second month as the offline fine\-tuning set, the third and fourth months as the online fine\-tuning set, and the final month as the test set\. For the standard RL method, the first four months would be allocated as the training set, and the last month as the test set\.
TABLE I:Time\-of\-Use Pricing SchemeTo validate the performance, this paper evaluates the following six methods, including two methods under the proposed SRL framework and four benchmark methods\.
#### IV\-A1Vanilla Supervised Reinforcement Learning \(SRL\-1\)
This is the vanilla implementation of the proposed SRL framework, where the fine\-tuning stage only consists of a single online fine\-tuning step\.
#### IV\-A2Supervised Reinforcement Learning with Two\-step Fine\-tuning \(SRL\-2\)
This is the proposed SRL framework with the proposed two\-step fine\-tuning method as illustrated in Section[III\-B](https://arxiv.org/html/2606.24947#S3.SS2)\.
#### IV\-A3Pre\-trained Policy \(PP\)
A policy is only pretrained with demonstrations in a supervised manner, which represents the baseline performance that is achieved before fine\-tuning\.
#### IV\-A4Vanilla PPO
This benchmark implements a standard PPO agent trained entirely from scratch\. This baseline agent’s policy is randomly initialized and refined exclusively through online interaction with the environment\.
#### IV\-A5Stochastic Model Predictive Control \(sMPC\)
To handle uncertainty, this method extends standard MPC by reformulating the objective in expectation form\. The expectation is estimated using a scenario\-based approach\. First, a large pool of 5,000 scenarios of the random variables is generated, and the scenario reduction technique in\[[9](https://arxiv.org/html/2606.24947#bib.bib17)\]is applied to distill the 10 most representative scenarios\. Similar to standard MPC, sMPC solves an optimisation problem with a given look\-ahead horizon but only implements the first\-step solution\. This process is then repeated at each decision step\.
#### IV\-A6Perfect MILP
To establish a performance upper bound, a deterministic MILP benchmark is formulated under the ideal condition of perfect information, i\.e\., the accurate and nonconvex system model and all future uncertainties are precisely known\.
To simulate forecasting uncertainty, we modeled all relevant inputs using normal distributions\. The ground truth value served as the mean, with a standard deviation set to 15% of the mean for demand and renewables, and 5% for temperature\. This approach was used consistently to generate scenarios for sMPC and to create the training and test sets for data\-driven methods\. All experiments are carried out on a workstation with NVIDIA GeForce RTX 3080 Ti GPU, Intel\(R\) Xeon\(R\) W\-3335 CPU, and 188GB RAM\. All optimization problems were solved using the Gurobi Optimizer \(version 10\.0\.3\)\. All codes are written based on the Python language and PyTorch framework\.
### IV\-BDemonstration Generation
The demonstration data for pre\-training can be derived from two primary sources: \(1\) historical logs of human decisions, which are often suboptimal due to uncertainty at the time of decision\-making; and \(2\) trajectories generated by re\-solving the problem using simulation models after all uncertain parameters have been revealed\. In the latter case, the problem may not be solved to global optimality due to limited computational resources or time constraints, and the simulation model may be inaccurate or biased, both of which can result in suboptimal demonstration data\.
To mimic these imperfections in the real\-world data sources, our case study employs a demonstration data generation method\. Leveraging the state distribution from our pre\-training dataset and the constructed simulation model, we use a deterministic optimization solver to find the control actions for each given state\. This procedure results in a collection of state\-action pairs\(𝒔,𝒂\)\(\\boldsymbol\{s\},\\boldsymbol\{a\}\), which form the basis of our demonstration dataset𝒟˙\\dot\{\\mathcal\{D\}\}\. To mimic the imperfections, we introduce an additional equality constraint to the optimization problem:
O=ρO~,O=\\rho\\,\\tilde\{O\},\(25\)whereOOis the objective function \([1](https://arxiv.org/html/2606.24947#S2.E1)\) of the optimization problem of the simulated models;ρ\\rhois the coefficient that controls the data quality;O~\\tilde\{O\}is theoretical optimum \(solved without the quality constraint \([25](https://arxiv.org/html/2606.24947#S4.E25)\)\)\. This constraint intentionally relaxes the solution’s optimality by forcing the objective value to be a specific multiple \(e\.g\., 1\.1, 1\.2, or 1\.3\) of the optimal objective values found without the constraint\. The distinct datasets embed different levels of control expertise:
- •Near\-Optimal \(NO\) Data: Without the quality constraint, the obtained dataset represents a highly proficient expert policy within a simulated environment, in which the embedded knowledge reflects the efficient utilization of both DG and ES\. When applied to the real\-world target, this can serve as a near\-optimal benchmark\.
- •High\-Quality \(HQ\) Data: By settingρ=1\.1\\rho=1\.1, the dataset contains suboptimal but still highly competent actions\. The control logic demonstrates a rational and effective utilization of both DG and ES resources\.
- •Medium\-to\-High\-Quality \(MtHQ\) Data: By settingρ=1\.2\\rho=1\.2, the embedded expertise in the dataset further degrades\. The policy reflects a reasonable dispatch strategy for DG but fails to use ES\.
- •Low\-Quality \(LQ\) Data: By settingρ=1\.3\\rho=1\.3, the dataset represents a significantly flawed expert\. The rationality of DG utilization is further diminished, occasionally including inefficient or counterintuitive actions, such as using DG in a low\-price period, while the ES remains entirely unutilized\.
It should be noted that this work does not explicitly address rare extreme events\. The online fine\-tuning step of SRL theoretically allows the agent to adapt, but this reactive process may still incur extra costs\. A proactive approach would be to integrate extreme scenarios into both the demonstration data and the simulated environment, and to include them as part of the performance evaluation\. Also note that the demonstration data generation process is agnostic to state distributions\.
### IV\-CTraining Performance of SRL\-1
We first validate the effectiveness of our proposed framework without the offline fine\-tuning step in the context of DER control and investigate its robustness to varying demonstration data quality\. The results of the experiment are presented in Fig\.[3](https://arxiv.org/html/2606.24947#S4.F3), which shows the convergent episode rewards for each algorithm in ten independent runs\. The suffixes appended to the algorithm names denote the quality of the demonstration data used for pre\-training\.
First, SRL\-1 consistently outperforms PP and PPO across all levels of demonstration quality, validating the effectiveness of the proposed SRL framework\. The results also demonstrate the notable robustness of SRL\-1 to data quality: even as demonstration quality decreases from near\-optimal to low, SRL\-1 still converges to a policy that outperforms the standard PPO baseline, highlighting its ability to effectively leverage and refine even imperfect expert knowledge\. As a side note, when comparing PP and PPO, it is interesting to observe that pure supervised learning \(even with the highest\-quality demonstrations\) still underperforms RL trained from scratch\. This suggests a slight misalignment between the supervised loss and the objective of training a control policy, and underscores the superior alignment of RL methods in control problems\.
Figure 3:Comparison of algorithms’ convergence performance with varying levels of quality for demonstration data\. The result displays the distribution of episode reward for each algorithm, aggregated over 10 independent trials\.
### IV\-DAblation Study of Offline Fine\-tuning
Figure 4:The online fine\-tuning reward curves of SRL\-1 and SRL\-2 with varying levels of demonstration quality\. Note that SRL methods have gone through an offline fine\-tuning step\.This section provides an ablation study to verify the effectiveness of the proposed two\-step fine\-tuning method in Section[III\-B](https://arxiv.org/html/2606.24947#S3.SS2)\. It should be noted that the duration of the offline fine\-tuning is a critical hyperparameter\. Too few episodes may leave the policy unprepared, while too many risk overfitting to the simulation, which could impede sim\-to\-real transfer during the final online fine\-tuning\. Based on preliminary tests, we established a range of 2000\-4000 episodes as effective\. For this experiment, we fine\-tuned the pre\-trained policy for 3000 episodes in the simulated environment\.
The results are presented in Fig\.[4](https://arxiv.org/html/2606.24947#S4.F4), which shows the average training reward curves \(in the online fine\-tuning step\) of ten independent runs for each method\. It can be observed that, for any given quality of demonstration data, SRL\-2 outperforms SRL\-1 in both the initial performance at the start of online training and the final converged reward\. A potential reason is that the offline fine\-tuning step makes SRL\-2 better aligned to the control objective\. Consequently, when transferred to the real environment, although the sim\-to\-real gap still exists, the fine\-tuned policy can immediately explore higher\-quality experiences, making it less likely to be trapped in local optima and enabling it to achieve a higher reward upon convergence\. Overall, the results confirm that the offline fine\-tuning is a critical component for enhancing real\-world performance, particularly when leveraging realistically imperfect demonstration data for the pre\-training\.
### IV\-EOperation Analysis
Figure 5:Comparison of cumulative cost of the 30\-day test period\. Results are aggregated from 10 independent experimental runs\.To evaluate generalization performance, we tested the proposed framework against the benchmarks on a dedicated test set comprising 30 days of unseen data\. It is important to note that for the sMPC benchmark, we limited the comparison to prediction horizons of 1 to 3 hours\. This setting was based on two key factors: information advantage and computational tractability\. Firstly, our RL paradigm operates on single\-step predictive information, and providing sMPC with an extended multi\-hour forecast would constitute an unfair informational advantage\. Secondly, the sMPC algorithm’s reliance on scenario generation leads to a significant increase in computational complexity as the prediction horizon lengthens, compromising its real\-time feasibility\. The typical solve times for 30\-day test case of perfect\_MILP, sMPC\_1, sMPC\_2, sMPC\_3 are 6\.95s, 3666\.72s, 4351\.48s, 5030\.21s, respectively\.
The cumulative operational costs for all algorithms over the 30\-day test period are presented in Fig\.[5](https://arxiv.org/html/2606.24947#S4.F5)\. The PPO agent, trained from scratch without the benefit of demonstration guidance or model\-based information, performs the worst \(highest cost\)\. sMPC with a 1\-hour horizon \(sMPC\-1\) performs the second worst as the short timeframe is insufficient for efficient energy storage scheduling\. Notably, the SRL\-1, when pre\-trained on HQ demonstrations, surpasses the performance of sMPC\-3, even though the SRL\-1 has information disadvantages\. More impressively, our proposed SRL\-2 surpasses sMPC\-3 with only MtHQ demonstration data\. The top\-performing model, SRL\-2 pre\-trained with NO demonstrations, demonstrates the closest performance to the theoretical optimum \(perfect MILP\), with an average cumulative cost only £723\.88 higher, corresponding to a minimal performance gap of 6\.57%\.
Figure 6:Average behavior of the proposed algorithm for controlling DERs over the 30 test days: \(a\) energy dispatch result and SoC of ES; \(b\) TCL dispatch result and evolution of indoor temperatureIn addition to quantitative evaluation, a qualitative sanity check was performed by visualizing the control behavior of the SRL\-2 trained with HQ demonstrations on the test set, with the results presented in Fig\.[6](https://arxiv.org/html/2606.24947#S4.F6)\. This analysis confirms that the agent learned an intuitive and economically rational policy\. Fig\.[6](https://arxiv.org/html/2606.24947#S4.F6)\(a\) illustrates the average daily dispatch behavior of the energy units and the battery’s SOC\. The agent’s strategy clearly adapts to electricity prices: during low\-price periods, local demand is met by the external grid, and the ES is charged\. In contrast, during high\-price periods, the agent switches to local power generation via the DG and discharges the ES to minimize costs\. Fig\.[6](https://arxiv.org/html/2606.24947#S4.F6)\(b\) details the agent’s control of the TCL, showing the average indoor temperature relative to the temperature dead\-band \(indicated by the red dashed envelope\)\. Prior to the onset of the two daily price peaks, the agent increases the TCL’s energy input rate to pre\-cool the space\. By lowering the temperature within the comfort band ahead of time, the agent effectively reduces the need for costly cooling during peak\-price hours, thereby optimizing the overall electricity bill\.
### IV\-FScalability Analysis
In this section, a scalability test is conducted to verify the effectiveness of the proposed SRL on DER coordination problems of varying scales\. We conducted experiments with different numbers of DERs, ranging from 5 to 120\. The proposed framework is compared against the standard PPO baseline in terms of both training time and test performance\.
The comparison of training times between the proposed SRL and the standard PPO is presented in Fig\.[7](https://arxiv.org/html/2606.24947#S4.F7)\(a\)\. As depicted, the training duration for both methods escalates with the number of DERs\. The case of 120 DERs requires nearly 12 times the training time of the case of 5 DERs\. This is because the growth in DERs leads to a substantial expansion of the state and action spaces, which increases the per\-step computational complexity and consequently makes each iteration of the fine\-tuning more time\-consuming\. By comparison, the SRL requires a longer total training time compared to the PPO baseline as the pre\-training and offline fine\-tuning of SRL introduce a computational overhead\. However, this increase is modest and the relative time increase shrinks as the problem scale grows\. For the smallest\-scale case of 5 DERs, the training time increases by 14%\. This percentage gradually decreases to 5% for the large\-scale case of 120 DERs\. This trend can be attributed to the fact that the RL fine\-tuning dominates the overall training duration as the state and action spaces expand\.
Figure 7:Scalability test of the proposed SRL for different numbers of DERs, aggregated over 10 independent trials: \(a\) training time compared with standard PPO; \(b\) cost reduction compared with standard PPOThe cost reduction of the SRL over the standard PPO on the test set is presented in Fig\.[7](https://arxiv.org/html/2606.24947#S4.F7)\(b\)\. The cost reduction is calculated as the percentage reduction in the average cumulative cost achieved by SRL over 10 independent trials relative to the PPO baseline\. The result demonstrates that SRL achieves a substantial performance improvement across all scales\. The cost reduction is particularly pronounced in the case of 30 DERs, where a 10% increase in training time yields a cost reduction of over 10%\. However, a decline occurs in the cost reduction when the number of DERs exceeds 30\. This phenomenon is likely a consequence of the curse of dimensionality\. Specifically, the expansion of the state and action spaces in the current single\-agent set\-up leads to increasing sparsity of training data, which significantly reduces sample efficiency and makes it more difficult for the agent to improve its policy\. Though the proposed SRL equips the agent with a reasonable base policy via pre\-training, the curse of dimensionality restricts the exploration efficiency for both methods, thus narrowing the relative performance gap in larger\-scale problems\. Future work can investigate multi\-agent reinforcement learning to alleviate this issue by factorizing the joint state\-action space into decentralized components for individual agents, while maintaining global coordination through shared training signals or communication mechanisms\.
## VConclusions
This paper proposes a Supervised Reinforcement Learning \(SRL\) framework for DER control problems\. This framework first establishes a baseline policy via supervised learning on demonstrations and subsequently fine\-tunes it using reinforcement learning \(RL\)\. Furthermore, we propose a two\-step fine\-tuning process, comprising: an offline step in a simulated environment to refine the policy, and an online step in the actual environment to adapt the policy to real\-world dynamics\. Through comprehensive experiments, we demonstrate that the implementations based on the proposed framework achieve superior performance against all benchmarks\. Notably, the proposed framework exhibits exceptional robustness, achieving high cost efficiency even when trained with low\-quality demonstration data\.
## References
- \[1\]Y\. Baiet al\.\(2022\)Training a helpful and harmless assistant with reinforcement learning from human feedback\.External Links:2204\.05862,[Link](https://arxiv.org/abs/2204.05862)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p2.1)\.
- \[2\]F\. Charbonnier, T\. Morstyn, and M\. D\. McCulloch\(2022\)Scalable multi\-agent reinforcement learning for distributed control of residential energy flexibility\.Applied Energy314,pp\. 118825\.External Links:ISSN 0306\-2619Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p3.1)\.
- \[3\]C\. Crozier, M\. Deakin, T\. Morstyn, and M\. McCulloch\(2019\)Incorporating charger efficiency into electric vehicle charging optimization\.InISGT\-Europe,Vol\.,pp\. 1–5\.External Links:[Document](https://dx.doi.org/10.1109/ISGTEurope.2019.8905734)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1),[§II\-A2](https://arxiv.org/html/2606.24947#S2.SS1.SSS2.p3.1)\.
- \[4\]M\. Dorokhova, Y\. Martinson, C\. Ballif, and N\. Wyrsch\(2021\)Deep reinforcement learning control of electric vehicle charging in the presence of photovoltaic generation\.Applied Energy301,pp\. 117504\.External Links:ISSN 0306\-2619,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/j.apenergy.2021.117504),[Link](https://www.sciencedirect.com/science/article/pii/S0306261921008874)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[5\]S\. Gao, C\. Xiang, M\. Yu, K\. T\. Tan, and T\. H\. Lee\(2022\)Online optimal power scheduling of a microgrid via imitation learning\.IEEE Transactions on Smart Grid13\(2\),pp\. 861–876\.External Links:[Document](https://dx.doi.org/10.1109/TSG.2021.3122570)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p3.1)\.
- \[6\]S\. Gao, Y\. Xu, Z\. Zhang, Z\. Wang, X\. Zhou, and J\. Wang\(2025\)Multiagent imitation learning\-based energy management of a microgrid with hybrid energy storage and real\-time pricing\.IEEE Internet of Things Journal12\(12\),pp\. 19801–19817\.External Links:[Document](https://dx.doi.org/10.1109/JIOT.2025.3541350)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p3.1)\.
- \[7\]R\. Gelaroet al\.\(2017\)The modern\-era retrospective analysis for research and applications, version 2 \(merra\-2\)\.Journal of Climate30\(14\),pp\. 5419 – 5454\.External Links:[Document](https://dx.doi.org/10.1175/JCLI-D-16-0758.1),[Link](https://journals.ametsoc.org/view/journals/clim/30/14/jcli-d-16-0758.1.xml)Cited by:[§IV\-A](https://arxiv.org/html/2606.24947#S4.SS1.p1.1)\.
- \[8\]H\. Hao, B\. M\. Sanandaji, K\. Poolla, and T\. L\. Vincent\(2015\)Aggregate flexibility of thermostatically controlled loads\.IEEE Transactions on Power Systems30\(1\),pp\. 189–198\.External Links:[Document](https://dx.doi.org/10.1109/TPWRS.2014.2328865)Cited by:[§II\-A3](https://arxiv.org/html/2606.24947#S2.SS1.SSS3.p1.11)\.
- \[9\]H\. Heitsch and W\. Römisch\(2003\)Scenario reduction algorithms in stochastic programming\.Computational optimization and applications24,pp\. 187–206\.Cited by:[§IV\-A5](https://arxiv.org/html/2606.24947#S4.SS1.SSS5.p1.1)\.
- \[10\]R\. Kirk, I\. Mediratta, C\. Nalmpantis, J\. Luketina, E\. Hambro, E\. Grefenstette, and R\. Raileanu\(2024\)Understanding the effects of rlhf on llm generalisation and diversity\.External Links:2310\.06452,[Link](https://arxiv.org/abs/2310.06452)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p2.1)\.
- \[11\]Z\. Li, Y\. Xiang, and J\. Liu\(2025\)Forecasting error\-aware optimal dispatch of wind\-storage integrated power systems: a soft\-actor\-critic deep reinforcement learning approach\.Energy318,pp\. 134798\.External Links:ISSN 0360\-5442,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/j.energy.2025.134798),[Link](https://www.sciencedirect.com/science/article/pii/S0360544225004402)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[12\]S\. Liu, J\. Liu, N\. Yang, Y\. Huang, Q\. Jiang, and Y\. Gao\(2024\)Real\-time power scheduling through reinforcement learning from demonstrations\.Electric Power Systems Research235,pp\. 110638\.External Links:ISSN 0378\-7796,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/j.epsr.2024.110638),[Link](https://www.sciencedirect.com/science/article/pii/S0378779624005248)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p3.1)\.
- \[13\]C\. Lork, W\. Li, Y\. Qin, Y\. Zhou, C\. Yuen, W\. Tushar, and T\. K\. Saha\(2020\)An uncertainty\-aware deep reinforcement learning framework for residential air conditioning energy management\.Applied Energy276,pp\. 115426\.External Links:ISSN 0306\-2619,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/j.apenergy.2020.115426),[Link](https://www.sciencedirect.com/science/article/pii/S0306261920309387)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[14\]Y\. Luo, C\. Liu, and Q\. Lai\(2022\)Optimal scheduling for a multi\-energy microgrid by a soft actor\-critic deep reinforcement learning\.In2022 IEEE Power & Energy Society General Meeting \(PESGM\),Vol\.,pp\. 1–5\.External Links:[Document](https://dx.doi.org/10.1109/PESGM48719.2022.9916785)Cited by:[§IV\-A](https://arxiv.org/html/2606.24947#S4.SS1.p1.1)\.
- \[15\]E\. Mocanu, D\. C\. Mocanu, P\. H\. Nguyen, A\. Liotta, M\. E\. Webber, M\. Gibescu, and J\. G\. Slootweg\(2019\)On\-line building energy optimization using deep reinforcement learning\.IEEE Transactions on Smart Grid10\(4\),pp\. 3698–3708\.External Links:[Document](https://dx.doi.org/10.1109/TSG.2018.2834219)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[16\]T\. Morstyn, B\. Hredzak, R\. P\. Aguilera, and V\. G\. Agelidis\(2018\)Model predictive control for distributed microgrid battery energy storage systems\.IEEE Transactions on Control Systems Technology26\(3\),pp\. 1107–1114\.External Links:[Document](https://dx.doi.org/10.1109/TCST.2017.2699159)Cited by:[§II\-A2](https://arxiv.org/html/2606.24947#S2.SS1.SSS2.p3.1)\.
- \[17\]M\. Nakamoto, S\. Zhai, A\. Singh, M\. Sobol Mark, Y\. Ma, C\. Finn, A\. Kumar, and S\. Levine\(2023\)Cal\-ql: calibrated offline rl pre\-training for efficient online fine\-tuning\.InAdvances in Neural Information Processing Systems,A\. Oh, T\. Naumann, A\. Globerson, K\. Saenko, M\. Hardt, and S\. Levine \(Eds\.\),Vol\.36,pp\. 62244–62269\.External Links:[Link](https://proceedings.neurips.cc/paper_files/paper/2023/file/c44a04289beaf0a7d968a94066a1d696-Paper-Conference.pdf)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p4.1)\.
- \[18\]R\. Sansom and G\. Strbac\(2012\)The impact of future heat demand pathways on the economics of low carbon heating systems\.InBIEE\-9th Academic conference,pp\. 10\.Cited by:[§IV\-A](https://arxiv.org/html/2606.24947#S4.SS1.p1.1)\.
- \[19\]J\. Schulman, F\. Wolski, P\. Dhariwal, A\. Radford, and O\. Klimov\(2017\)Proximal policy optimization algorithms\.External Links:1707\.06347,[Link](https://arxiv.org/abs/1707.06347)Cited by:[§III\-B](https://arxiv.org/html/2606.24947#S3.SS2.p5.1)\.
- \[20\]Y\. Shin, J\. Kim, W\. Jung, S\. Hong, D\. Yoon, Y\. Jang, G\. Kim, J\. Chae, Y\. Sung, K\. Lee, and W\. Lim\(2025\)Online pre\-training for offline\-to\-online reinforcement learning\.External Links:2507\.08387,[Link](https://arxiv.org/abs/2507.08387)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p4.1)\.
- \[21\]The International Energy Agency \(IEA\)Digitalisation and Energy\.Technical ReportThe International Energy Agency \(IEA\)\.Note:www\.iea\.org/reports/digitalisation\-and\-energyAccessed: 2025\-05\-22Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[22\]W\. Wang, G\. Tian, Q\. Z\. Sun, and H\. Liu\(2023\)A control framework to enable a commercial building hvac system for energy and regulation market signal tracking\.IEEE Transactions on Power Systems38\(1\),pp\. 290–301\.External Links:[Document](https://dx.doi.org/10.1109/TPWRS.2022.3156867)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[23\]Y\. Wang, D\. Qiu, M\. Sun, G\. Strbac, and Z\. Gao\(2023\)Secure energy management of multi\-energy microgrid: a physical\-informed safe reinforcement learning approach\.Applied Energy335,pp\. 120759\.External Links:ISSN 0306\-2619,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/j.apenergy.2023.120759),[Link](https://www.sciencedirect.com/science/article/pii/S030626192300123X)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[24\]L\. Yu, W\. Xie, D\. Xie, Y\. Zou, D\. Zhang, Z\. Sun, L\. Zhang, Y\. Zhang, and T\. Jiang\(2020\)Deep reinforcement learning for smart home energy management\.IEEE Internet of Things Journal7\(4\),pp\. 2751–2762\.External Links:[Document](https://dx.doi.org/10.1109/JIOT.2019.2957289)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[25\]Z\. Zhang, D\. Zhang, and R\. C\. Qiu\(2020\)Deep reinforcement learning for power system applications: an overview\.CSEE Journal of Power and Energy Systems6\(1\),pp\. 213–225\.External Links:[Document](https://dx.doi.org/10.17775/CSEEJPES.2019.00920)Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.
- \[26\]Y\. Zhou, C\. Essayeh, and T\. Morstyn\(2024\)Aggregated feasible active power region for distributed energy resources with a distributionally robust joint probabilistic guarantee\.IEEE Transactions on Power Systems40\(1\),pp\. 556–571\.Cited by:[§I](https://arxiv.org/html/2606.24947#S1.p1.1)\.Similar Articles
Scalable Constrained Multi-Agent Reinforcement Learning via State Augmentation and Consensus for Separable Dynamics
This paper presents a distributed approach for constrained multi-agent reinforcement learning that uses state-augmented policy learning and neighbor-to-neighbor consensus over dual variables to satisfy global resource constraints while scaling linearly with the number of agents. Experiments on smart grid demand response demonstrate that consensus coordination is essential for feasibility, scaling to thousands of agents unlike centralized training approaches.
Cutting AI Datacenter Energy with Reinforcement Learning: Measured Power Control of LLM Training from One GPU to the Fleet
A new arXiv paper explores using reinforcement learning to reduce AI datacenter energy consumption by dynamically controlling power for LLM training workloads across scales from a single GPU to entire fleets.
LLM-Enhanced Multi-Agent Reinforcement Learning for Unified Electric Vehicles-Charging Station-Grid Optimization in Public Charging Systems
This paper proposes an LLM-enhanced multi-agent reinforcement learning framework to simultaneously optimize electric vehicle charging scheduling, station profitability, and grid stability, using LLMs for feature selection and adaptive weighting, outperforming state-of-the-art methods with reduced training time.
Smart charging of large fleets of Electric Vehicles: Independent Multi-Agent Reinforcement Learning approaches
This paper compares contextual combinatorial bandits and policy gradient algorithms for decentralized smart charging of large EV fleets, using a realistic simulation with dynamic pricing and renewable energy data.
Co-RL: Unsupervised Reasoning Emerges from Diverse Cohort in Multi-agent RL
Co-RL is a cooperative multi-agent framework that enables unsupervised reasoning improvement in language and vision-language models by using peer-derived rewards, reducing reliance on ground-truth labels and mitigating training collapse through increased cohort diversity.