Manuscript Offprint
arXiv:2610.09712Boundary-aware Reinforcement Learning for Hypercube State Spaces via Deterministic Policy Gradient
Abstract
We develop a continuous-time deterministic policy gradient framework for reinforcement learning with reflected state dynamics, where the state process is governed by a controlled reflected stochastic differential equation on a hypercube. Under suitable regularity assumptions, we establish the connection between the value function and the Neumann Bellman equation, introduce an advantage-rate function that yields a deterministic policy gradient formula, and prove the martingale characterization theorem. Motivated by these theoretical results, we propose a continuous-time deep deterministic policy gradient algorithm for reflected stochastic systems, in which the Neumann boundary condition is imposed via either soft penalization or hard architectural constraint. We further quantify the discrepancy between the ideal continuous-time dynamics and the discretely sampled exploratory dynamics executed in practice, showing that the error decays as the time grid is refined and exploration noise vanishes. Our experiments on reservoir control problems illustrate the effectiveness of the RL framework, highlighting that boundary-aware methods substantially reduce Neumann boundary residuals and enhance learning stability.
Keywords: reflected diffusion process, deterministic policy gradient, reinforcement learning, Neumann boundary condition, reservoir regulation.
1 Introduction
Reinforcement learning (RL) provides a general framework for sequential decision making in which an agent improves its policy through repeated interaction with an unknown environment. Classical RL has been developed predominantly in discrete time, where the environment is modeled as a Markov decision process and the agent updates value functions or policies from sampled transitions. Among the most influential value-based methods, Q-learning (see Watkins (1989) and Watkins and Dayan (1992)) learns the optimal state-action value function in a model-free manner and has become a cornerstone of discrete-time RL. Temporal-difference learning (Sutton (1988)), SARSA (Rummery and Niranjan (1994)), and actor-critic methods (Konda and Tsitsiklis (2000), Sutton and Barto (2018)) further established the algorithmic foundation for modern RL. The combination of value-based RL with deep neural networks led to the deep Q-network (DQN) (Mnih et al. (2015)), which
*lijunbo@xidian.edu.cn, School of Mathematics and Statistics, Xidian University, Xi'an, 710126, China
yijie.huang@polyu.edu.hk, Department of Applied Mathematics, The Hong Kong Polytechnic University, Kowloon, Hong Kong, China.
luchenhao_ustc@mail.ustc.edu.cn, School of Mathematical Sciences, University of Science and Technology of China, Hefei, 230026, China demonstrated that high-dimensional sensory inputs can be handled by deep function approximation. Policy-gradient methods (Williams (1992) and Sutton et al. (2000)) and their actor-critic variants have also become central in continuous-action control, where direct optimization of a parameterized policy is often more natural than maximization over a discrete action set.
Despite these successes, many real-world decision problems are not intrinsically discrete in time. Robotic manipulation, autonomous driving, high-frequency trading, queueing networks, energy storage, and water reservoir regulation all involve systems whose states evolve continuously and whose decisions may be updated at high frequency. Early attempts to bring RL into continuous time include advantage updating (Baird (1994)), the continuous-time value-function and policy-improvement framework of Doya (2000), and the stochastic control perspective of Munos and Bourgine (1997). These works already emphasized that the continuous-time formulation should not be viewed as a mere limiting case of a fixed discrete-time algorithm. A central difficulty is that objects that are well behaved in discrete time may degenerate when the time step becomes small. In particular, Tallec et al. (2019) showed that standard Q-learning-type methods can be highly sensitive to time discretization in near continuous-time environments, and that the classical discrete-time Q-function is not the right object in the continuous-time limit. This observation motivates the development of RL algorithms directly at the continuous-time level, with time discretization introduced only at the implementation stage.
A systematic stochastic-control formulation of continuous-time RL was introduced by Wang et al. (2020), where exploration is modeled through entropy-regularized relaxed controls for diffusion processes. Building on this formulation, Jia and Zhou (2022a) developed a martingale approach to policy evaluation in continuous time and space, showing that the value function of a fixed policy can be characterized by the martingality of a suitable reward-adjusted process. The same martingale viewpoint was then used in Jia and Zhou (2022b) to derive continuous-time policy gradient and actor-critic algorithms. A major step toward value-based learning in continuous time was made by Jia and Zhou (2023), who introduced the continuous-time counterpart of Q-learning. Since the usual 'big' Q-function collapses to the value function in continuous time, Jia and Zhou (2023) defined a first-order state-action object, the so-called 'little' q-function, which is closely related to the instantaneous advantage rate and the Hamiltonian. This q-function can be characterized by martingale conditions and used to design on-policy and off-policy actor-critic algorithms without discretizing the control problem in advance. The continuous-time RL literature has since expanded in several directions. Continuous-time q-learning has been extended to mean field control problems, where the state distribution enters the dynamics and reward, and the integrated and essential q-functions arise naturally (see Wei et al. (2024) and Wei and Yu (2025)). More recently, Ren et al. (2026a) investigated mean field control with controlled common noise and the accompanying work Ren et al. (2026b) developed martingale-based q-learning and actor-critic algorithms for this formulation. Related martingale and q-learning ideas have also been developed for jump-diffusion models, both under Shannon entropy Gao et al. (2025) and under Tsallis entropy Bo et al. (2024b). Another line of work studies the accuracy of discretely sampled stochastic policies, addressing the gap between continuous-time exploratory formulations and implementable piecewise-constant action processes (see Jia et al. (2025)). These developments show that continuous-time RL is not only a mathematical limit of discrete-time RL, but a distinct framework in which stochastic calculus, martingale methods, Hamilton-Jacobi-Bellman equations, and policy optimization interact.
in a fundamental way.
Most of the above continuous-time RL works are formulated with stochastic or relaxed policies. This is natural for exploration, but it also creates computational and conceptual difficulties. First, the relaxed policy is a measure-valued control, and its implementation therefore requires high-frequency sampling from the prescribed action distribution. Second, stochastic policies introduce an additional action-integration layer into policy evaluation and policy improvement. In continuous action spaces, expectations with respect to the policy distribution must generally be computed analytically or approximated by Monte Carlo sampling. The latter may increase the computational cost of the policy update, especially for high-dimensional action spaces. These considerations motivate deterministic policy gradient methods, which optimize a parameterized deterministic feedback policy. In discrete time, deterministic policy gradient methods (Silver et al. (2014)) provide an efficient alternative to stochastic policy gradients in continuous action spaces, since the policy gradient only integrates over the state distribution. The deep deterministic policy gradient algorithm (DDPG) by Lillicrap et al. (2015) combines this idea with replay buffers and target networks, two stabilizing devices inherited from deep Q-learning. Recently, deterministic policy gradients have also been developed directly in continuous time. Cheng et al. (2025) derived a continuous-time deterministic policy gradient formula through the advantage-rate function and proposed a CT-DDPG algorithm based on martingale characterization. This framework has subsequently been extended to time-inconsistent stochastic control, where Guo et al. (2026) combined deterministic policy-gradient updates, martingale characterizations and inner fixed-point iterations to learn deterministic equilibrium policies. In the mean-field direction, Cheng et al. (2026) developed a model-free deterministic actor-critic framework for extended mean-field control, in which both the dynamics and rewards may depend on the joint distribution of states and controls. This line of work is particularly relevant to applications in which deterministic feedback controls are ultimately intended for implementation.
The present paper studies a complementary issue that has received much less attention in continuous-time RL: state boundary. In many applications, the state process is constrained by some limits. For example, a reservoir has lower and upper storage bounds; an inventory system has capacity constraints; a queue length or storage process may be constrained to remain nonnegative; an engineering system may be required to stay inside a prescribed safe region. A natural mathematical model for such constrained dynamics is a reflected stochastic differential equation. When the state reaches the boundary, a finite-variation regulator pushes it back into the admissible domain. On a hypercube, this reflection acts componentwise on the lower and upper faces. The corresponding Bellman equation is therefore not an ordinary interior PDE, but a parabolic equation with Neumann boundary condition. The boundary condition determines how the critic should behave on reflecting faces, how the boundary regulator enters Itô's formula, and how one should design stable value-function approximations near the boundary.
Motivated by these observations, this paper develops a boundary-aware actor-critic RL framework for reflected diffusion control on a hypercube. For a fixed policy, the value function satisfies a Neumann Bellman equation. We then use this structure to construct a continuous-time deep deterministic policy gradient method for reflected dynamics, which we call CT-DDPG-R. The main contributions of this paper are summarized as follows.
(i) For a fixed parameterized deterministic Markov policy, we characterize the corresponding value function through a parabolic Bellman equation on the interior of the hypercube together with Neumann conditions on its reflecting faces. We derive a continuous-time deterministic policy gradient formula. A key feature of the analysis is that the regulator terms disappear from the final gradient expression because the value function satisfies the Neumann boundary condition. The result extends continuous-time deterministic policy gradient theory from unconstrained diffusions to state-constrained reflected systems. Then, we introduce the continuous-time advantage-rate function associated with a deterministic policy and establish a martingale characterization of both the value function and the advantage-rate function.
(ii) Guided by the theoretical results, we propose CT-DDPG-R, a boundary-aware continuous-time deterministic policy algorithm. The method combines martingale-based critic learning, deterministic actor updates, experience replay, target networks, and two treatments of the Neumann condition: a soft Neumann penalty in the critic loss and a hard Neumann architecture based on cosine Fourier features. We evaluate the proposed method on one-, two-, and five-dimensional reservoir regulation problems. The experiments demonstrate that incorporating the Neumann condition substantially reduces boundary residuals and improves training stability, with the advantages becoming more pronounced as the state dimension increases.
(iii) The theoretical target policy is a continuous-time deterministic feedback, whereas the actions executed during training are sampled on a discrete time grid and perturbed by exploration noise. We quantify the discrepancy between the reflected state process under the ideal target policy and the process generated by the implementable piecewise-constant exploratory actions. The resulting estimate provides a theoretical justification for the discrete-time data-collection procedure used in CT-DDPG-R.
The rest of the paper is organized as follows. Section 2 introduces the controlled reflected SDE on a hypercube and the objective functional. Section 3 derives the Neumann Bellman equation for a fixed deterministic policy and connects it with the value function. Section 4 establishes the deterministic policy gradient formula and develops the martingale characterizations used for model-free learning. Section 5 presents the CT-DDPG-R algorithm with the soft and hard constraints, and estimates the error of the state process in real environment. Section 6 applies our algorithm to the reservoir control problems and reports its performance.
Let and for . Consider a hypercube given by whose inner is . We then introduce the following reflected dynamics on the hypercube given by Q, which is given by, for with ,
where is an m-dimensional Brownian motion defined on the filtered probability space with the filtration satisfying the usual conditions, and is the square-integrable initial data independent of . Here, is the -adapted control strategy which takes values on a convex and compact action set , and are coefficients of reflected dynamics. In particular, are continuous and componentwisely non-decreasing processes satisfying and for any ,
The -th element of is pushed only when it hits the corresponding lower or upper face. Equation (2.1) can be understood in the standard Skorokhod sense on (see Pilipenko (2014)).
In contrast to the stochastic policies commonly adopted in prior continuous-time RL works (e.g., Jia and Zhou (2023)), which require sampling from action distributions and integrating over continuous action spaces, we adopt a deterministic Markov policy framework. Under this setting, the control action at time and state is prescribed by a deterministic feedback law of the form , with . To enable flexible function approximation and integration with deep learning, we introduce a parameterized family of deterministic policies , indexed by the parameter vector .
Let be the running reward and be the terminal reward. Now, we fix a discount factor . For any policy parameter , let be the reflected state process satisfying (2.1) with the Markovian feedback control for . The performance of this policy is measured by the following dynamical expected cumulative return given by, for and ,
and we aim to maximize over .
3 Neumann Bellman Equation on Hypercube
In this section, we characterize the value function through a Neumann Bellman equation on the hypercube. Before that, several assumptions are imposed to ensure that our problem is well posed and that the associated value function is well defined.
Assumption 3.1 (Regularity of Coefficients). The functions , and are continuous in . Moreover, there exists a constant such that, for any , ,
Assumption 3.2 (Regularity of Feedback Policy). The map is continuous on . Moreover, for any compact parameter set , there exists such that for any .
Remark 3.1. Assumptions 3.1, 3.2 yield that the closed-loop coefficients and are Lipschitz in . Since satisfies the uniform exterior sphere condition and the uniform cone condition, it follows from Theorem 2.5.4 in Pilipenko (2014) that reflected stochastic differential equation (RSDE) (2.1) has a unique strong solution for each fixed .
Assumption 3.3 (Uniform Ellipticity). The diffusion coefficient satisfies the uniform ellipticity condition, i.e., there exists a constant such that for and . Here, .
To support the subsequent theoretical derivations of the deterministic policy gradient and the martingale characterization, we impose the following regularity assumption on the value function :
Assumption 3.4. For each fixed policy parameter , the value function with . Furthermore, its 1st and 2nd spatial derivatives are absolutely integrable over for any , i.e., there exists a function such that
Remark 3.2. For reflected diffusion control problems defined on hypercubes, the value function is conventionally characterized via standard dynamic programming and viscosity solution theory as the unique continuous viscosity solution to the corresponding Neumann boundary value problem (3.1). Nevertheless, to the best of our knowledge, a general classical regularity theorem for such reflected hypercube control problems remains absent in the existing literature. In this work, we impose the regularity condition with , instead of the stronger regularity requirement . This distinction is critical for problem formulations on hypercube domains. Specifically, compatibility conditions, which connect the terminal condition and the Neumann boundary condition, may be violated. As a result, full classical regularity over the closed cylindrical domain cannot be generally guaranteed. The regularity assumption adopted herein aligns with the classical regularity results established in Bo et al. (2024a) for Robin boundary value problems on the nonnegative orthant.
Before deriving the Neumann Bellman equation, we record a basic property of reflected diffusions that will be used repeatedly below. Although the finite-variation regulators and accumulate when the process hits the boundary, the state process itself does not spend positive Lebesgue time on the boundary. In other words, the reflection is carried by boundary local time, which is singular with respect to the time variable (c.f. Proposition 6.1 in Kang and Ramanan (2014)).
Lemma 3.1. Under Assumptions 3.1, 3.2 and 3.3, let be a strong solution to the RSDE (2.1) under . Then , a.s..
We define the controlled generator associated with a fixed action by, for ,
Then, we have the following result on the HJB equation for reflected diffusion processes under deterministic feedback policies.
Lemma 3.2. Let Assumptions 3.1, 3.2, 3.3 and 3.4 hold. Then, the value function defined by (2.2) satisfies the following Neumann boundary value problem given by
where the index sets and are respectively defined by and . Conversely, if a function satisfying is a classical solution of (3.1), then it admits the probabilistic representation (2.2).
Proof. Let and write for . We first prove the interior equation in (3.1). Fix . We choose such that , where . Given , define the stopping time . For , no reflection occurs for , and hence for . Applying Itô's formula to from to , and using the dynamic programming principle (DPP), we obtain
Dividing both sides of (3.2) by and letting , the dominated convergence theorem (DCT), together with the continuity of the coefficients and of the derivatives of in , yields that
Substituting into (2.2) gives the terminal condition for all .
Next, we prove the Neumann boundary condition in (3.1). Fix and , where denotes the relative interior of the face . We choose a neighborhood of such that . Given , let . On , the only possible regulator term is . By DPP, the interior equation and Lemma 3.1 yield that
We now show that by contradiction. Suppose first that . By continuity of , we may assume that , for all .
By Assumption 3.3, the diffusion is uniformly nondegenerate. Since the reflected state process starts from the boundary face, the regulator increases with positive probability before , that is . Hence, we have
which contradicts (3.3). The case leads to an analogous contradiction. Hence, we have for all . The proof for the upper face is analogous, and applying the same contradiction argument yields that for all . Thus we can extend the result to the whole by the continuity of .
Conversely, suppose that with be a classical solution of (3.1). Fix and set . For , we define
It follows from Itô's rule that
The terms vanish by the Neumann boundary condition, and the drift term vanishes by the interior equation in (3.1) and Lemma 3.1. Consequently, is a martingale. Applying the martingality on the right hand of (3.4), it follows that
Let and then the continuity of , the terminal condition and the boundedness of the compact set jointly imply that
which is precisely . Thus, the proof of the lemma is complete.
4 Policy Gradient and Martingales on Hypercube
In this section, we establish two theoretical foundations for reflected diffusion control on the hypercube: a deterministic policy gradient proposition and a martingale characterization. The first result follows the line of deterministic policy gradient methods developed in Silver et al. (2014) and Cheng et al. (2025), while the second extends the martingale approach of Jia and Zhou (2023) for controlled diffusions to the reflected state setting. These two results correspond, respectively, to the policy-improvement and policy-evaluation components of the actor-critic algorithm developed in the next section. In particular, the deterministic policy gradient formula provides the direction for updating the actor, whereas the martingale characterization yields model-free learning conditions for the value function and the advantage-rate function.
4.1 Deterministic policy gradient on the hypercube
For each , we define the continuous-time advantage rate function by
Then, we have from Lemma 3.2 that
To establish the deterministic policy gradient, we need additional differentiability of the coefficients and feedback policy with respect to the action variable and the policy parameter.
Assumption 4.1. The functions , , and exist and are continuous on . Moreover, the partial derivative is continuous on .
Fix . By using the differentiability from Assumption 4.1, we can take the derivative with respect to on the both side of (4.1), and hence, for ,
We also need to derive a stability property of the closed-loop system under parameter perturbations. The following lemma asserts that small changes in the policy parameter result in corresponding small changes in the resulting state trajectory in the mean-square sense, uniformly over the entire time horizon.
Lemma 4.1. Let Assumptions 3.1 and 3.2 hold. Then, for any and , it holds that
Proof. We write and , and define the corresponding closed-loop coefficients , , and . Let and satisfy the following dynamics without reflection:
Then, the reflected processes and can be represented via a so-called Skorokhod map on the hypercube by and , which means that , are solutions respectively to the Skorokhod problems and . Moreover, the Skorokhod map is Lipschitz in the sup norm (c.f. Dupuis et al. (1991)).
Consider for and we have for some constant . From Jensen's inequality and Burkholder-Davis-Gundy Inequality (BDG Inequality), it follows that
Note that . Since is Lipschitz in , the first term . We can choose , so that, by Assumption 3.2, there exists such that for , which yields . Here, the constant depends on the compact set of parameters containing both and . For the second term, we consider which tends to zero since is compact and the mapping is continuous. Then . Combining these estimates, we obtain that . A similar argument for the diffusion coefficient gives that . Consequently, we obtain
This implies that . It follows from Gronwall's inequality that as . Thus, the desired -uniform stability is established.
We now present the main result of this section, which gives the deterministic policy gradient for reflected diffusions on a hypercube.
Proposition 4.1. Let assumptions of Lemma 3.2 and Assumption 4.1 hold. Then, for any , the mapping is Gâteaux differentiable. More precisely, for any ,
This equivalently yields that
Proof. The case is immediate, since the terminal condition does not depend on . We therefore fix and , and consider a perturbed policy parameter for . For any , by applying the Itô's rule to on , we have
Using the Neumann boundary condition in (3.1), the reflection terms vanish. Integrating over and taking expectations given , we obtain
Since and is compact, letting , and the DCT yields that
(4.5)
On the other hand, by the definition of , we have
(4.6)
Subtracting (4.5) from (4.6) gives that
By using Lemma 3.1 and (4.2), we obtain
which yields that
This yields that
By Lemma 4.1, in probability for every . Moreover, the continuity of and , together with the continuity of in the state and action variables, implies that the integrand on the right side of (4.7) converges to in probability, -a.e..By Assumption 3.4 and (4.3), there exists a deterministic function independent of such that for all . Furthermore, for sufficiently small , is uniformly bounded by a deterministic constant because and is continuous on a compact set. Hence, we have from DCT that
which completes the proof and yields (4.4).
Proposition 4.1 extends the classical deterministic policy gradient of Cheng et al. (2025) to the continuous-time setting with reflected state dynamics. Notably, the reflection terms are absent from the final gradient formula: the Neumann boundary condition exactly cancels the boundary regulator contributions, ensuring that the actor update depends only on the interior dynamics.
4.2 Martingale characterization on the hypercube
We now give the martingale characterization used for learning the value function and the advantage-rate function. The conditions imposed on the candidate pair are consistent with the Neumann Bellman equation and the properties of the advantage-rate function. A key feature of the following characterization is that the martingale condition is not imposed only along the closed-loop trajectory generated by . Instead, it is required to hold under the locally perturbed of . This leads to an off-policy learning scheme with exploration.
Theorem 4.2. Let assumptions of Lemma 3.2 hold. Fix . Let the candidate value function with , and the candidate advantage function satisfy
Assume moreover that for every , there exists a neighborhood of such that, for every , there exists a square-integrable -valued adapted control process with , , under which the process
is an F-martingale, where the reflected state process solves the dynamics:
Then, for and for .
Proof. Define the function for . We prove that for any . Suppose that there exist and such that . By using the continuity of , there exist such that for satisfying . Without loss of generality, we may take . Then there exists an A-valued adapted control process with , a.s. such that the process defined by
is an -martingale. Let the stopping time . By the continuity of and the property as , we have a.s.. For , applying the Itô rule to on , we obtain
By the boundary condition (4.8), the reflecting terms vanish. Since is still a martingale, its finite-variation part must vanish. Therefore, for all ,
Since , we may apply (4.10) up to time , and obtain that
which is a contradiction. Hence, for all . Taking and using (4.9), we get for all . Together with the boundary condition (4.8), this shows that is a classical solution of the Neumann boundary problem (3.1). By Lemma 3.2, it follows that on . Then, we conclude that for all and .
5 Model-free CT-DDPG-R Algorithm
In this section, we design the model-free continuous-time actor-critic algorithm for reflected diffusion control based on the theoretical results in Section 4. To ensure that the parameterized neural networks are consistent with the conditions (4.8) required by the theoretical framework, we introduce two boundary-aware approximation methods: a soft penalty formulation and a hard architectural constraint. We also analyze the discrepancy between the ideal continuous-time state process under the target policy and the state process generated in practical implementation by discretely sampled, piecewise-constant exploratory controls, and derive an upper bound for this approximation error.
5.1 Algorithm design
Unlike model-based control approaches, our continuous-time RL framework does not assume prior knowledge of the coefficients b and governing the state dynamics and the reward functions r and g. Instead, we assume only that the agent can interact with the environment and collect trajectory data in the form of state-action-reward tuples. Proposition 4.1 and Theorem 4.2 provide the theoretical underpinnings for a model-free actor-critic implementation: the martingale characterization enables critic learning from temporal-difference (TD) residuals, while the policy gradient theorem guides the actor update toward improved performance.
We introduce parametric function approximators , , for the value function, the advantage-rate function, and the deterministic policy, where , , and denote the respective parameter vectors. To avoid that the parameters , for value network and policy network change too fast, we use target networks , updated by
with controlling the update rate. Following Cheng et al. (2025), we enforce the normalization condition (4.9) via the reparameterization
for the current policy when training the critic.
In our paper, two methods are adopted to address the Neumann boundary condition:
• Soft constraint. The soft constraint approach uses a standard neural network without architectural modifications, but adds the critic loss with a boundary penalty term. Specifically, we sample boundary points from the faces of the hypercube and penalize the squared normal derivatives of the value function:
• Hard constraint. For the hypercube domain, the Neumann boundary condition can be imposed exactly by constructing the value network using cosine Fourier features. Inspired by Straub et al. (2025), we embed the state coordinates through cosine functions of multiple frequencies, which naturally satisfy zero normal derivatives at the boundaries. The value network takes the form
(5.1)
where the integer frequencies are chosen in order to approximate the high frequency or multiscale data. It is obvious that the neural network (5.1) incorporates the Neumann condition by the property of cosine function.
Fix a time step and we get the time grid with . In step , the agent observes the state , selects an exploration action , and receives the next state together with the running reward . We store transitions of the form in a replay buffer . To encourage sufficient exploration of the state-action space, we adopt a perturbed version of the current deterministic policy:
where is a small variance to explore the behavior around , is the d-dimensional identity matrix, and denotes projection onto the action set A when needed. This exploration scheme injects Gaussian noise into the action, allowing the agent to explore the environment around the current policy and gather informative samples for learning the advantage-rate function.
We adopt the multi-step TD method when training the value network and the advantage-rate network. For any L-step sampled subsequence which is sampled from the replay buffer , we define the following martingale TD given by
where is the target value network. This residual is precisely the discrete-time approximation of the martingale condition from Theorem 4.2. After sampling a batch of B such subsequences, we compute the martingale loss
Minimizing this loss drives the critic toward satisfying the martingale characterization, thereby aligning the value and advantage-rate estimates with the underlying dynamics. To enforce the terminal condition , we also add a terminal penalty
where the terminal states are sampled randomly from Q.
The overall critic loss is therefore a weighted combination of the martingale loss, the terminal penalty and, if using the soft constraint, the boundary penalty:
with weights and (where for the hard constraint). The critic parameters are then updated via semi-gradient descent:
Motivated by the deterministic policy gradient in Proposition 4.1, we update the actor parameters by ascending the following objective:
where are sampled from replay buffer and the actor parameters are updated as
The full procedure of continuous-time deep deterministic policy gradient with reflection (CT-DDPG-R) on hypercube is described in Algorithm 1.
Algorithm 1 CT-DDPG-R on the hypercube
Require: Time step , time grid , discount rate , number of episodes , policy net , advantage-rate net , value net , critic update frequency , actor update frequency , trajectory length , exploration noise , soft update parameter , learning rates , batch sizes , loss weight .
1: Initialize , target and buffer
2: for do
3: Observe the initial state , collect the transitions from a trajectory by exploratory action
.
4: for do
5: Sample a batch of -step trajectories and compute the martingale loss .
6: Sample a batch of terminal points and compute the terminal penalty .
7: Sample a batch of boundary points and compute the boundary penalty .
8: Compute the critic loss .
9: Update by and .
10: end for
11: Sample a batch of states from and compute the policy loss .
12: Update by .
13: Update target networks: .
14: end for
5.2 Accuracy of discretely sampled exploratory dynamics
We now turn to quantify the discrepancy between the ideal continuous-time reflected dynamics governed by the deterministic policy and the dynamics actually executed during training. This analysis is crucial for understanding the approximation error introduced by the discrete-time implementation of our otherwise continuous-time algorithm. Let
denote a uniform time grid and its mesh size, respectively. For , define the left-endpoint projection . To model the exploration noise injected by the algorithm, let be i.i.d. random variables in satisfying , , and let be the exploration scale.
5.2.1 Extension of the probability space
To accommodate the independent random exploration noise generated by the algorithm, we extend the underlying probability space accordingly. Let be a probability space supporting . Define the product space , , . On the extended space , we set , , . For notational simplicity, we retain the original symbols in place of . We equip the extended space with the enlarged filtration for , where denotes the family of -null sets. By independence, remains a Brownian motion with respect to .
5.2.2 Discretely executed exploratory reflected dynamics
In the actual implementation, the agent updates its action only at the discrete grid points . At each intervention time , the algorithm samples the exploratory action
and holds it constant on , that is, for . This piecewise-constant action construction mirrors the actual execution of the algorithm, where the policy is evaluated and the action is updated at regular intervals of length .
Consequently, the reflected state process under this discretely sampled exploratory policy satisfies
where the regulators enforce the reflection on the boundary of Q. In contrast, the ideal deterministic reflected dynamics, which would be obtained if the action could be updated continuously in time, is governed by
Both the sampled and the ideal processes are defined on the same product space . The following lemma ensures that the exploratory algorithm is well-defined at every step of the simulation, justifying the use of the piecewise-constant action approximation.
Lemma 5.1 (Well-posedness of the exploratory dynamics). Under the assumptions of Lemma 3.2, for every grid and every , the reflected SDE (5.2) admits a unique strong solution adapted to .
Proof. We proceed by induction over the grid intervals. The case at is immediate from the initial condition . Suppose that for some , the reflected SDE (5.2) admits a unique strong solution on . Then we have , and
On , we consider the following reflected SDE
For fixed , it follows from Assumptions 3.1 and 3.2 that
for some constant . Therefore, the reflected SDE admits a unique strong solution on . This extends the solution to , completing the induction. Hence the unique strong solution exists on the entire horizon .
5.2.3 State process error
We now analyze the discrepancy between the ideal continuous-time trajectory and the discretely sampled exploratory trajectory. This analysis is essential for quantifying the approximation error introduced by the piecewise-constant action implementation and the exploration noise.
For notational convenience, we introduce the shorthand , , and define the state deviation process .
Theorem 5.1. Under the assumptions of Lemma 5.1, there exists a constant C > 0, independent of G and , such that
Proof. Define the differences in drift and diffusion coefficients as
Then the deviation process satisfies the SDE
Applying Itô’s formula to gives that
We claim that . For the lower face, if , we have and then, . For the upper face, if , we have , and then . Therefore, we obtain that . An analogous argument applied to the ideal regulator gives . Adding the two inequalities gives , which yields
By the Lipschitz condition in Assumption 3.1, for some constant . Therefore, . Let . Taking expectations and supremum on both sides of (5.4), and applying the BDG inequality and Young's inequality, we obtain
Thus, it follows that
It remains to bound the action discrepancy. For , since is nonexpansive and , we have
For the second term on the right side, we apply Itô's formula and obtain
By the same argument as before, we know that the reflection term is non-positive, that is
Then we obtain
where . By Gronwall's inequality, we conclude that for some constant independent of and .
Thus, we have
Substituting this bound into (5.5) yields
By Gronwall's inequality, we have , which is precisely the desired error bound (5.3).
5.2.4 Objective error
We now translate the state error bound into a bound on the difference between the ideal and the actually executed objective values. Recall that the ideal objective under the deterministic policy is
while the objective achieved by the discretely sampled exploratory policy is
Corollary 5.2. Under the assumptions of Lemma 5.1, there exists a constant C > 0, independent of G and , such that
Proof. By Lipschitz continuity of r in and g in x, it follows that
for some constant C > 0. Applying Theorem 5.1 gives
Similarly, from the proof of Theorem 5.1, we have
and hence . Combining these estimates yields the desired objective error bound.
Corollary 5.2 provides a quantitative guarantee that the performance of the discretely executed exploratory policy converges to that of the ideal deterministic policy as the time grid becomes finer ( ) and the exploration noise vanishes ( ). The error bound reveals a trade-off inherent in the algorithm design: while exploration noise is necessary for learning the advantage-rate function in an off-policy manner, it introduces a bias in the objective relative to the ideal deterministic policy. Furthermore, this error analysis justifies the use of piecewise-constant action approximations in the implementation of the continuous-time algorithm. The bound assures us that the discrepancy between the theoretical ideal and the practical implementation is controlled by quantities that can be made arbitrarily small at the agent's discretion, which provides a rigorous foundation for the effectiveness of the CT-DDPG-R algorithm.
6 Numerical Experiments
In this section, we execute the proposed CT-DDPG-R algorithm on a family of reflected reservoir control problems (Pliska (1975), Lai et al. (2022), Luo et al. (2025)). Reservoir systems provide a natural class of constrained continuous-time control tasks: the state variables represent water-level deviations from desired levels, and the admissible state region is a bounded box imposed by physical storage capacities and safety limits. We compare the soft constraint, hard constraint and the additional unconstrained case of the Neumann boundary condition in the value approximation.
6.1 One-dimensional reservoir with an explicit optimal solution
We first consider a one-dimensional reservoir control problem for which the optimal value function and optimal policy admit an explicit analytical solution. This experiment serves as a valuable test for validating the proposed algorithm, as it allows us to compare the learned approximations against the ground truth.
Let denote the deviation of a reservoir level from its target level with , and let be the regulation rate (i.e., the rate at which water is released or retained) with . The reflected state dynamic is governed by
where the local time processes and increase only when the process X hits the lower boundary -H and the upper boundary H respectively. Our goal is to maximize the discounted reward
Here the running and terminal rewards are given by , with , which penalize deviations from the target water level during operation and at the terminal time, and is the admissible set of all -adapted processes taking values in .
For this problem, the associated HJB equation takes the form
By symmetry, is even in . Since the value decreases as increases, we have for , and for . Therefore, the optimal policy has a bang-bang form:
Thus the optimal controller pushes the reservoir level toward the target level with maximal admissible intensity. Let , , and write . Under the bang-bang control (6.1), the transformed function C satisfies the following linear parabolic equation on the half-interval
This equation is linear and can be solved explicitly via eigenfunction expansion. Define the constants , for . The eigenfunctions of the operator with Neumann boundary conditions are , and for , with corresponding eigenvalues , for . Let
Then the expansion holds, and the solution of the transformed PDE is given by
Thus, by a standard verification argument, the optimal value function admits the explicit series representation
In the numerical experiment, the infinite series in (6.2) is approximated by the first 150 eigenfunctions, and the coefficients are computed by numerical quadrature on 4000 grid points, ensuring sufficient accuracy for the ground truth. The parameters are , , , , , , . The value network, advantage-rate network, and policy network are fully connected neural networks with three hidden layers, 64 hidden units per layer and hyperbolic tangent activations. The actor output is bounded by . The hard value network uses the cosine frequencies for the rescaled state variable. We train for 3000 episodes with with Gaussian exploration noise decaying from 0.5 to 0.2. The deterministic return is evaluated every 50 episodes using 100 rollout paths.
Figure 1 reports the returns without exploration and the boundary residual during the updating process. We can see a clear separation among the three boundary treatments in terms of the Neumann boundary residual which confirms that both boundary-aware treatments effectively encode the structure of the value network. It is worth noting that the unconstrained neural networks, due to strong expression power, are still able to recover the value function and the optimal bang-bang policy with reasonable accuracy; see Figures 2. Nevertheless, we find that the unconstrained training process exhibits more pronounced oscillations and occasional degradation. In contrast, the soft and hard boundary treatments provide additional structural information and therefore lead to more stable learning dynamics in many runs.
At the same time, this experiment also shows a limitation of imposing the boundary condition that the learning process may quickly drive the policy toward the boundary and remain trapped there for a long period of training, especially under the hard constraint. This issue is no longer observed in the subsequent reservoir experiments, where the running reward contains a logarithmic boundary penalty. In favor of the boundary penalty, as the dimension of the state space increases and the value function and policy become more complex, the benefit of incorporating the Neumann constraints becomes more visible and they lead to faster and more stable convergence than the unconstrained baseline.

Figure 1: Returns and boundary residual

Figure 2: Value functions and policies under different constraints
6.2 Two-dimensional reservoir cascade regulation
We next consider a two-dimensional reservoir cascade. Let be the water-level deviation of reservoir , and let be the relative release rate of reservoir . A larger release from reservoir 1 reduces the upstream level but increases the downstream inflow into reservoir 2. The reflected dynamics are governed by the following system of RSDEs:
Here is the mean net inflow deviation of reservoir , which may vary over time due to seasonal or stochastic factors, and is the downstream transfer coefficient. The term models the fraction of the upstream release that enters the downstream reservoir. The reflection terms ensure that the state process remains within the admissible hypercube by enforcing normal reflection at the boundaries.
The running reward is
The first two terms penalize deviations of each reservoir from its target level, encouraging the system to maintain desired storage volumes. The third term penalizes imbalance between the relative storage levels of the two reservoirs, promoting an equitable distribution of water across the cascade. The fourth and fifth terms penalize aggressive control which causes operational costs. The logarithmic terms serve as barrier functions that increasingly penalize states approaching the boundary of the admissible domain, thereby discouraging the system from operating near the physical limits. The terminal reward is analogously defined as
In this experiment, the parameters are set as , , , , , , , , , , , , , , and . The value, advantage-rate, and actor networks are fully connected networks with three hidden layers, 128 hidden units per layer, and tanh activations. For the hard Neumann method, the value network replaces the raw state input by cosine features with frequencies in each coordinate. The actor is bounded componentwise by . We train for 4000 episodes and the returns during training can be seen in Figure 3 with five times the standard deviation for visual clarity. Since no closed-form solution is available for this two-dimensional problem, we evaluate the learned policies qualitatively by visualizing their surfaces at selected time slice. Figures 4, 5, and 6 display the learned policy functions for the unconstrained, soft-constrained, and hard-constrained approaches, respectively.

Figure 3: Returns during training
To provide a quantitative reference, we also compute a finite-difference approximation of the optimal policy by numerically solving the associated HJB equation using the method of Kushner and Dupuis (2001); the resulting reference policy is shown in Figure 7. While the finite-difference reference exhibits some numerical oscillations owing to the limitations of grid-based discretization in two dimensions, the overall qualitative structure is broadly consistent across all methods. Notably, the agreement with the reference policy becomes more apparent when the Neumann boundary condition is incorporated through either the soft or hard constraint, suggesting that boundary awareness helps the neural network capture the correct boundary behavior. These results further support the conclusion that the proposed boundary-aware treatments effectively encode the structural information which is helpful for stable and accurate learning in multidimensional settings.
Learned policy
Learned policy


Figure 4: Policy surfaces without boundary constraint at t = 0.5.
6.3 Five-dimensional reservoir cascade regulation
Finally, to assess the scalability of the proposed method to higher-dimensional settings, we consider a five-dimensional reservoir cascade. The state vector is given by
Learned policy
Learned policy


Figure 5: Policy surfaces under soft constraint at t = 0.5.
Learned policy
Learned policy


Figure 6: Policy surfaces under hard constraint at t = 0.5.
where is the water-level deviation of reservoir from its target level. The control represents the release rates. The reflected diffusion dynamics are governed by
The drift structure remains the same as in the two-dimensional cascade, with each reservoir receiving inflow from its upstream neighbor: and for . We set the net inflow deviations to , for .
The running reward is designed to capture the same operational objectives as in the lower-dimensional cases, now extended to five reservoirs:
and the terminal reward is analogously defined as


Figure 7: Finite-difference reference policy at t = 0.5.
In the experiment, we choose the parameters as , , , , , for , , , , and , , . The value, advantage-rate, and actor networks use five hidden layers with 128 hidden units per layer and tanh activations. The hard Neumann value network uses cosine frequencies in each state coordinate. We train for 4000 episodes and display the returns in Figure 8 with five times the standard deviation for visual clarity. The same as in the two-dimensional experiment, the results here demonstrate that both the soft and hard boundary treatments lead to more stable and faster convergence than the unconstrained baseline. The boundary-aware methods achieve slightly better final performance, as showed in the return curves, and the learned policy surfaces exhibit smoother and more physically plausible behavior. This observation reinforces the central message of this paper: incorporating structural information about the Neumann boundary condition into the value network, whether through a soft penalty or a hard architectural constraint, provides significant benefits in terms of learning stability and final performance, particularly as the state dimension increases and the control problem becomes more complex.
Five-reservoir cascade regulation

Figure 8: Returns during training.
References
L. C. Baird. Reinforcement learning in continuous time: Advantage updating. In Proceedings of the IEEE International Conference on Neural Networks, 4:2448–2453, 1994.
L. Bo, Y. Huang and X. Yu. A decomposition-homogenization method for Robin boundary problems on the nonnegative orthant. Electronic Journal of Probability, 29:1-25, 2024.
L. Bo, Y. Huang, X. Yu and T. Zhang. Continuous-time q-learning in jump-diffusion models under Tsallis entropy. Mathematics and Financial Economics, online first, https://doi.org/10.1007/s11579-026-00419-4, 2026.
L. Bo, Y. Huang and X. Yu. On optimal tracking portfolio in incomplete markets: The reinforcement learning approach. SIAM Journal on Control and Optimization, 63(1):321–348, 2025.
Z. Cheng, X. Guo and Y. Zhang. Deterministic Policy Gradient for Reinforcement Learning with Continuous Time and State. arXiv preprint arXiv:2509.23711, 2025.
Z. Cheng, X. Guo, H. Pham and Y. Zhang. Actor-critic learning for extended mean field control with deterministic policies. arXiv preprint arXiv:2607.11005, 2026.
K. Doya. Reinforcement learning in continuous time and space. Neural Computation, 12(1):219–245, 2000.
P. Dupuis and H. Ishii. On lipschitz continuity of the solution mapping to the Skorokhod problem, with applications. Stochastics and Stochastic Reports, 35(1):31-62, 1991.
X. Gao, L. Li and X. Y. Zhou. Reinforcement learning for jump-diffusions, with financial applications. Mathematical Finance, 1-32, 2025.
X. Guo, Y. Huang and X. Yu. Deterministic policy gradient for learning equilibrium in time-inconsistent control problems. arXiv preprint arXiv:2606.11798, 2026.
Y. Jia and X. Y. Zhou. Policy evaluation and temporal-difference learning in continuous time and space: A martingale approach. Journal of Machine Learning Research, 23(154):1–55, 2022.
Y. Jia and X. Y. Zhou. Policy gradient and actor-critic learning in continuous time and space: Theory and algorithms. Journal of Machine Learning Research, 23(275):1–50, 2022.
Y. Jia and X. Y. Zhou. q-Learning in continuous time. Journal of Machine Learning Research, 24(161):1-61, 2023.
Y. Jia, D. Ouyang and Y. Zhang. Accuracy of discretely sampled stochastic policies in continuous-time reinforcement learning. SIAM Journal on Control and Optimization, 64(3):1889-1929, 2026.
W. Kang and K. Ramanan. Characterization of stationary distributions of reflected diffusions. The Annals of Applied Probability, 24(4):1329-1374, 2014.
V. R. Konda and J. N. Tsitsiklis. Actor-critic algorithms. In Advances in Neural Information Processing Systems, 12, 2000.
H. J. Kushner and P. Dupuis. Numerical Methods for Stochastic Control Problems in Continuous Time. Springer, second edition, 2001.
V. Lai, Y. F. Huang, C. H. Koo, A. N. Ahmed and A. El-Shafie. A Review of Reservoir Operation Optimisations: from Traditional Models to Metaheuristic Algorithms Arch Computat Methods Eng, 29:3435–3457, 2022.
T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver and D. Wierstra. Continuous control with deep reinforcement learning. In International Conference on Learning Representations, 2015.
W. Luo, C. Wang, Y. Zhang, J. Zhao, Z. Huang, J. Wang and C. Zhang. A deep reinforcement learning approach for joint scheduling of cascade reservoir system. Journal of Hydrology, 2025.
V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg and D. Hassabis. Human-level control through deep reinforcement learning. Nature, 518:529–533, 2015.
R. Munos and P. Bourgine. Reinforcement learning for continuous stochastic control problems. In Advances in Neural Information Processing Systems, 10, 1997.
A. Pilipenko: An introduction to stochastic differential equations with reflection. Potsdam University Press, 2014.
S. R. Pliska: A diffusion process model for the optimal operation of a reservoir system. Journal of Applied Probability, 12(4):859-863, 1975.
Z. Ren, X. Wei, X. Yu and X. Y. Zhou. Continuous-time q-learning for mean-field control with common noise, Part I: Theoretical foundations. arXiv preprint arXiv:2604.27372, 2026.
Z. Ren, X. Wei, X. Yu and X. Y. Zhou. Continuous-time q-learning for mean-field control with common noise, Part II: q-learning algorithms. arXiv preprint arXiv:2604.27378, 2026.
G. A. Rummery and M. Niranjan. On-line Q-learning using connectionist systems. Technical Report, 1994.
D. Silver, G. Lever, N. Heess, T. Degris, D. Wierstra and M. Riedmiller. Deterministic policy gradient algorithms. In Proceedings of the 31st International Conference on Machine Learning, PMLR 32(1):387–395, 2014.
C. Straub, P. Brendel, V. Medvedev and A. Rosskopf: Hard-constraining Neumann boundary conditions in physics-informed neural networks via Fourier feature embeddings. ICLR 2025 Workshop on Machine Learning Multiscale Processes, 2025.
R. S. Sutton. Learning to predict by the methods of temporal differences. Machine Learning, 3:9–44, 1988.
R. S. Sutton, D. McAllester, S. Singh and Y. Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in Neural Information Processing Systems, 12, 2000.
R. S. Sutton and A. G. Barto. Reinforcement Learning: An Introduction. MIT Press, second edition, 2018.
C. Tallec, L. Blier and Y. Ollivier. Making deep Q-learning methods robust to time discretization. In Proceedings of the 36th International Conference on Machine Learning, PMLR 97:6096–6104, 2019.
H. Wang, T. Zariphopoulou and X. Y. Zhou: Reinforcement Learning in Continuous Time and Space: A Stochastic Control Approach. Journal of Machine Learning Research, 21(198):1–34, 2020.
C. J. C. H. Watkins. Learning from delayed rewards. Robotics & Autonomous Systems, 1989
C. J. C. H. Watkins and P. Dayan. Technical note: Q-learning. Machine Learning, 8:279–292, 1992.
X. Wei and X. Yu. Continuous-time q-learning for mean-field control problems. Applied Mathematics and Optimization, 91(10), 2025.
X. Wei, X. Yu and F. Yuan. Unified continuous-time q-learning for mean-field game and mean-field control problems. arXiv preprint arXiv:2407.04521 2024.
R. J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8:229–256, 1992.
A. Zălinescu: Second order Hamilton–Jacobi–Bellman equations with an unbounded operator. Nonlinear Anal., 75(13):4784-4797, 2012.
H. Zhao, W. Tang and D. D. Yao. Policy optimization for continuous reinforcement learning. In Advances in Neural Information Processing Systems, 36, 2023.