Simulation-aided Reinforcement Learning with Control Variates
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
Simulation-aided Reinforcement Learning with Control Variates
arXiv:2611.12643v1 [cs.LG] 9 Nov 2026
Omer Hemo, Ido Sefi, Mirco Mutti, Aviv Tamar, Kfir Y. Levy Department of Electrical and Computer Engineering Technion - Israel Institute of Technology omer.hemo@campus.technion.ac.il
Abstract Reinforcement Learning (RL) algorithms often rely on data collected from a target environment, which can be expensive and noisy. Although simulators can generate large amounts of additional data, standard simulation mixing approaches—which directly combine simulated and real experience—can degrade performance due to simulator inaccuracies, especially when they bias the solution away from the optimal policy. We propose a conservative simulation-aided learning method based on control variates, where simulated data is used solely to reduce variance in the learning process rather than directly shaping the learning target. We develop our approach for Policy-Evaluation, which is a fundamental building block of RL algorithms. Then we combine it within the actor-critic framework towards policy improvement, as well as extend it towards offline RL scenarios. Experiments on multiple MuJoCo benchmark tasks demonstrate improvements over standard simulation mixing approaches, highlighting control variates as an effective tool for simulation-aided reinforcement learning. Code is available at https://github.com/OmerHemo/ Simulation-Aided-Reinforcement-Learning-with-Control-Variates.
1
Introduction
Reinforcement Learning [RL, 28] has had remarkable success on a variety of complex sequential decision problems. Nonetheless, those successes are mostly confined to settings in which almost unlimited data are available, oftentimes coming from “perfect” simulators of the decision process of interest, such as in videogames [33] or reasoning tasks [14]. In many practical scenarios instead, simulators are available, or they can be developed, but they are not “perfect”. They typically cannot match the complexity of the real environment, for which they only provide a biased, approximate surrogate. This bias generates a gap between what we can learn in simulation and what we would like to achieve in the real world. Mitigating this gap is the focus of a large body of work on sim-to-real adaptation [43, 51, 29, 4, 1, 30, 9, 36, 5, 49, 50, 54, 53]. Differently from previous works, here we are not interested in training robust policies in simulation for zero-shot transfer to the real world [4], nor into exploiting real world data to improve the simulator and reduce its inherent bias [49]. Instead, we embrace the simulator bias to tackle an orthogonal research question: Can we exploit biased but abundant data coming from an “imperfect” simulator in combination with real-world experience to improve the real-world performance? A representative domain to reason about the setting is as follows. We may want to train a navigation policy for a quadruped robot while interacting online with the physical world. While processing the real-world experience on our computing infrastructure, we can draw additional data from a simulator of the robot, which runs at a substantially higher frequency. While the simulator differs from the physical environment in some key parameters, such as friction, gravity, contact forces, the effect of 40th Conference on Neural Information Processing Systems (NeurIPS 2026).
simulated actions may be correlated with the effect of the same action in the real world, meaning that the biased simulated data may carry some useful information to improve the real-world policy. We formalize this setting as simulation-aided reinforcement learning, in which the real environment and the simulator are represented by Markov decision processes (MDPs) with identical specifications except for their transition model. A naïve approach [8, 25] to this setting, which we refer to as sim-mixing, is to just feed our RL base algorithm with a mixture of the simulated and real data and to forget about the bias. This has been proved to work surprisingly well in practice, especially when the mixing parameter is carefully tuned [8], often improving the variance relative to training on real only. However, sim-mixing is bound to fail when the bias in simulated transitions is severe. An approach to tackle the bias is to use importance sampling (IS) [38], in which the probability of the simulated transitions is reweighted to match the distribution of samples from the real environment. While this results in unbiased estimates, the additional variance introduced by the weighting can grow large [16, 32], possibly erasing all the benefits from exploiting the simulated data. In this paper, we consider a control variates approach to simulation-aided RL. In a plain statistical setting, let X a quantity of interest we aim to estimate. A control variate [CV, 38] is a random variable Y , with known expectation E[Y ], that is correlated to X. The CV allows us to rephrase the initial estimation problem on the random variable Z = X − (Y − E[Y ]), which is unbiased, with provable statistical benefits [2]. In our setting, X stands for the quantity of interest in the real environment, Y is the same quantity in simulation, for which the expectation can be obtained by drawing large number of simulated samples. With this interpretation, we develop a family of CV solutions to various simulation-aided RL settings. We corroborate the proposed CV approach both theoretically and empirically, showing that it often combines the unbiasedness of IS with the low variance of sim-mixing, while consistently outperforming or matching training on real data only, even when the bias of the simulator is severe. Specifically, our contributions are: • We formally define the simulation-aided RL problem. • We propose a control variates approach to policy evaluation in the introduced setting, for which we analyze theoretical and practical benefits. • We show how improved policy evaluation can be integrated in online and offline RL algorithms, such as Soft Actor Critic [15] and Conservative Q-Learning [20]. • We conduct an experimental campaign on several tasks from the MuJoCo suite, where we show that our CV approach matches or outperforms alternative methods for the simulation-aided RL setting, including standard sim and real mixing schemes [8], PAR [26], and VGDF [55].
2
Background
P Notation. For a set X , we denote |X | its size and ∆X := {p ∈ [0, 1]|X | | x∈X p(x) = 1} the 2 probability simplex over it. For a random variable X, we denote E[X] its expectation, V[X] = σX its variance. For two random variables X, Y , their covariance is Cov(X, Y ). Similarly, for random vectors we have V[X] := E ∥X − E X∥22 and Cov(X, Y ) := E⟨X − E X, Y − E Y ⟩, where ∥ · ∥p denotes the ℓp norm and ⟨·, ·⟩ is the inner product. 2.1
Estimation with Biased Data
Let X ∼ P a random variable distributed with P , and let f a function of X for which we aim to estimate the expectation EP [f (X)]. In a typical statistical setting, we have access to a set of measurements {f (xi )}ni=1 , where xi are i.i.d. realizations of X. The Monte Carlo (MC) estimator Pn of EP [f (X)] is then given by Ŷ = i=1 f (xi )/n. It is well-known that V(Ŷ ) = σf2 /n, implying that Ŷ may encompass a high error when n is small. In such settings, to reduce the variance of the estimate, one may turn to additional information coming from biased data. Importance sampling. In some scenarios, we may access a large set of measurements {f (xi )}N i=1 from the same function f on realizations {xi }N i=1 that are sampled i.i.d. from a distribution Q instead of the target distribution P . A direct MC approach on these measurements would result in a biased estimate approaching EQ [f (X)] with N → ∞. The importance sampling (IS) estimator accounts PN for the distribution shift by computing ŶIS = N1 i=1 w(xi )f (xi ), where w(x) := P (x)/Q(x) is 2
the importance weight. The resulting estimate is unbiased and its variance is smaller than an MC estimator when N ≫ n and P, Q are similar distributions [38]. Control variates. In other scenarios, we may access an additional set of measurements {h(xi )}ni=1 from a function h on realizations sampled i.i.d. from X ∼ P , for which we know the expectation EP (h(X)). The function h is often called a control variate [CV, 38]. We can define a control variate Pn estimator ŶCV = n1 i=1 fcv (xi ) where fcv (x) = f (x) − λ h(x) − EP [h(X)] , such that the information from the control variate is exploited to adjust the MC estimate of EP [f (X)] with a parameter λ ∈ R. It is easy to see that the estimator is unbiased, while the variance of a point-estimate is given by σf2cv = σf2 + λ2 σh2 − 2λCov(f, h). The latter shows that the variance of the estimate can be reduced whenever the measurements from f and h are highly correlated (i.e., Cov(f, h) is large). Notably, the variance depends on λ, which can be tuned to minimize it as λ∗ = Cov(f, h)/σh2 , Cov(f,h)2 2 ∗ σf , so resulting in the point-estimate fcv (x) := fcv (x) λ=λ∗ with variance σf2cv ∗ = 1 − σ2 σ2 f
h
. the variance reduction grows with the absolute correlation |ρf h | = |Cov(f,h)| σf σh 2.2
Markov Decision Processes
A Markov Decision Process [MDP, 41] models sequential decision problems. An MDP is defined as M = (S, A, P, R, µ, γ), where S is the state space, A is the action space, P : S × A → ∆S is the transition model, R : S × A → [0, Rmax ] is the reward, µ ∈ ∆S is the initial state distribution, and γ ∈ (0, 1) is the discount factor. A policy π : S → ∆A describes the decision strategy of an agent interacting with the MDP according to the following protocol. First, a state s0 ∼ µ is drawn. Then, for every step t ≥ 0, the agent observes st , takes an action at ∼ π(st ), and collects a reward rt = R(st , at ), while the process transitions to the next state st+1 ∼ P (st , at ). This induces a distribution over the state-action pairs visited by π, from which the data are collected, which we denote by P π (s, a), and a corresponding distribution over transitions P π (s, a, s′ ) := P π (s, a) P (s′ | s, a). The quality of a decision policy π in a given state can be measured through the value function and the state-action value function, defined respectively as "∞ # "∞ # X X π t π t VP (s) := Eπ,P γ rt s0 = s , QP (s, a) := Eπ,P γ rt s0 = s, a0 = a . t=0
t=0
in which the expectation is taken over actions at ∼ π(st ) and state transitions st+1 ∼ P (st , at ), where the exponential discount ensures the sum remains finite. Reinforcement Learning [RL, 28] is a paradigm to solve MDPs from sampled interactions, i.e., without knowledge of the MDP specification. Solving the MDP refers to two classical problems. One is called policy evaluation, in which the goal is to estimate the value VPπ or QπP of a given policy π. The other is policy optimization, where the goal is to learn a policy π ∗ ∈ arg maxπ Eµ [VPπ (s)], which is called the optimal policy.
3
Problem Setting
In this paper, we consider a pair of MDPs Mreal = (S, A, Preal , R, µ, γ)
Msim = (S, A, Psim , R, µ, γ)
with the same specification of S, A, R, µ, γ but possibly different transition models. The MDP Mreal represents the real environment, i.e., the environment of interest in which we aim to solve typical policy evaluation and optimization problems. Differently from the usual setting, here we may access an additional environment Msim that simulates the real environment with some approximation error. Simulation-aided RL is concerned with the problem of evaluating or optimizing a policy by combining the information from the real environment Mreal and the simulator Msim . Our problem falls within the broader off-dynamics RL setting [10], which encompasses any transfer between MDPs with mismatched dynamics; our emphasis is on using simulation data to aid each policy update step in the real environment. Clearly, the setting is trivial whenever Psim ≈ Preal in distribution: Any RL algorithm treating simulated samples as real-world samples would be approximately optimal. The following result makes the latter statement precise. 3
Theorem 3.1 (Lemma 10.12, [28]). Let π a given policy and let q ∈ ∆S the stationary state distribution induced by π in Mreal . It holds (1 − γ)2 Eq [|VPπreal (s) − VPπsim (s)|] ≤ γRmax Eq,π [∥Preal (s, a) − Psim (s, a)∥1 ]. In this paper, we are especially interested in problems in which Eq,π [∥Preal (s, a) − Psim (s, a)∥1 ] is large, which means the simulated samples shall be handled with care. In the following sections, we first focus on the problem of policy evaluation. We describe common approaches and corresponding pitfalls, as well as a method to address them. Then, we show how the proposed policy evaluation solution can bring ripple benefits to policy optimization.
4
Simulation-aided Policy Evaluation
Here we study the problem of policy evaluation in the simulation-aided RL setting. Let π be the policy of which we aim to estimate the value in Mreal . We are provided with a dataset Dreal = {(s, a, s′ )ni=1 } taken with the policy π in Mreal . With this dataset, we aim to estimate QπPreal within a class of parametric models Qθ , where θ ∈ Rd . Typically, this is done by minimizing the squared temporaldifference (TD) error [46, 47], i.e., min L(θ) := Eπ,Preal δθ (s, a, s′ )2 , where δθ (s, a, s′ ) := Qθ (s, a)− R(s, a)+γVθ (s′ ) , (1) θ∈Rd with Vθ (s′ ) := Ea′ ∼π(s′ ) Qθ (s′ , a′ ) . To improve stability, it is common to employ a target network QTθ , which is a delayed copy of the current estimator Qθ . In particular, QTθ (s, a) := QT (s, a), where the target parameters θT are updated more slowly than θ, typically via an exponential moving average θT ← τ θ + (1 − τ )θT for some τ ∈ (0, 1). The use of such slowly updated target networks is known to significantly stabilize temporal-difference learning [34, 23, 11]. Therefore, in practice δθ (s, a, s′ ) = Qθ (s, a) − R(s, a) + γV T (s′ ) , with V T (s′ ) := Ea′ ∼π(s′ ) QT (s′ , a′ ) . While the problem of minimizing the squared TD error for policy evaluation is well-understood [7], here we are interested in studying whether a superior estimate can be obtained by exploiting an additional dataset of transitions Dsim = {(s, a, s′ )N i=1 } taken with the policy π in Msim . 4.1
Common Approaches and Their Pitfalls
Simulator-mixing datafrom simulations and real to minimize the approaches [8, 25] combine π π objective: EPsim δθ (s, a, s′ )2 + EPreal δθ (s, a, s′ )2 . One can also control simulator bias by using π π a weighting coefficient 0 ≤ α ≤ 1 to get α EPsim δθ (s, a, s′ )2 + (1 − α) EPreal δθ (s, a, s′ )2 , as it is done in [8]. We refer to this weighted objective as regular sim-mixing and denote the resulting Q-estimation method by Reg-Qmix; it serves as our main mixing baseline throughout the paper. If we recall the TD error (1), we can see that, for every α > 0, we are comparing Qθ (s, a)hwith biased targets. Importance sampling [38] can correct the bias of the expectation as i π Preal (s,a,s′ ) ′ 2 π α EPsim . This ratio can explode in some settings. For instance, if both the P π (s,a,s′ ) δθ (s, a, s ) sim
transition models are deterministic, e.g., Preal (s, a) = I{s′ = s1 } , Psim (s, a) = I{s′ = s2 }, then the IS ratio tends to zero or infinity. 4.2
Policy Evaluation with Control Variates
An alternative approach to address the bias is through control variates (CV, see Section 2). In the case of the TD error in Eq. 1, the underlying random variable is the transition tuple (s, a, s′ ), and the corresponding function is the temporal-difference error δ(s, a, s′ ). We define the real TD error and simulated Bellman error [3, 33] as: δθreal (s, a, s′ ) := Qθ (s, a) − r(s, a) + γV T (s′ ) , δθsim (s, a) := Qθ (s, a) − r(s, a) + γEs̃′ ∼Psim (·|s,a) [V T (s̃′ )] . Then, we can write the CV objective real ′ 2 sim 2 sim 2 π [w(s, a)δ π [δ LCV (θ) = Es,a,s′ ∼Preal θ (s, a, s ) − λδθ (s, a) ] + λ Es,a∼Psim θ (s, a) ]
4
(2)
P π (s,a)
where w(s, a) is the IS density ratio w(s, a) = Preal . Applying IS to the pair (s, a) is better than π sim (s,a) ′ π π on the triplet (s, a, s ), since the distributions Preal (s, a) and Psim (s, a) are necessarily closer than π π the non-marginalized Preal (s, a, s′ ) and Psim (s, a, s′ ). Empirical Loss. To compute (2), we use the datasets Dreal and Dsim . In addition, we construct an n auxiliary dataset D̃real = {(s, a, s′ , {s̃′ }K j=1 )}i=1 by taking each (s, a) pair from Dreal , resetting the simulator to state s, and executing action a to generate s̃′ . For stochastic simulators, we collect K independent next-state samples for each (s, a) pair. For example, in the MuJoCo simulator, the state consists of the robot’s joint positions and velocities, which are also the inputs provided to the learned policy π. Resetting the simulator to a specified configuration of joint positions and velocities is therefore straightforward. This capability is also available in many other physics simulators, such as NVIDIA Isaac Sim [37] and PyBullet [6]. 4.3
Analysis of the Gradient of the Empirical CV Loss
Since our goal is to optimize LCV (θ) using gradient-based methods, we study the bias and variance of the resulting gradient estimators. Throughout, θ is fixed and gradients treat the target V T as a constant, as in any TD method with a target network. As is standard in covariate-shift analyses [e.g., 2, 45, 12, 24], we assume access to the density ratio w. The gradient of the empirical CV loss is ĝλ =
n N i 1 Xh λ X w(s̃j , ãj ) ∇θ δθsim (x̃j )2 , ∇θ δθreal (xi )2 − λ ∇θ δθsim (xi )2 + n i=1 N j=1
(3)
where xi ∈ D̃real , x̃j ∈ Dsim , and δθsim uses the average of V T over the available simulated next states (K for D̃real , one for Dsim ). Its behaviour is governed by the expected real and simulated gradients at a state–action pair, b(s, a) := 2 Qθ (s, a) − r(s, a) − γ Es′ ∼Preal (s,a) V T (s′ ) ∇θ Qθ (s, a), b̃(s, a) := 2 Qθ (s, a) − r(s, a) − γ Es̃′ ∼Psim (s,a) V T (s̃′ ) ∇θ Qθ (s, a), together with the transition noise and the variance of the importance-weighted term, h i π ∥∇θ Qθ (s, a)∥22 Vs′ ∼Preal (s,a) V T (s′ ) , σT2 := 4γ 2 Es,a∼Preal 2 π σIS := Vx̃∼Psim w(s̃, ã) ∇θ δθsim (x̃)2 , the simulator counterpart σ̃T2 of σT2 (same expression with Psim ) and the simulator value mismatch h 2 i π ∆2V T := Es,a∼Preal Es′ ∼Preal (s,a) V T (s′ ) − Es̃′ ∼Psim (s,a) V T (s̃′ ) We can characterize the bias and variance of the CV loss gradient estimator as follows. Theorem 4.1 (Gradient bias and variance). Assume access to the density ratio w and let the samples in D̃real and Dsim be drawn independently. For every λ ∈ R and K ≥ 1: π [b(s, a)] = E[ĝ0 ], which is the gradient of the TD objective (1); (i) E[ĝλ ] = Es,a∼Preal 1 λ2 σ̃T2 λ2 2 π (ii) V[ĝλ ] = V b − λb̃ + σT2 + + σIS , with b, b̃ evaluated at (s, a) ∼ Preal ; n K N Cov(b, b̃) (iii) V[ĝλ⋆ ] ≤ V[ĝ0 ] for the variance minimizer λ⋆ = V[b̃]+σ̃2 /K+n σ2 /N ; IS T (iv) V b − λb̃ ≤ 2(1 − λ)2 V[b] + 8λ2 γ 2 G2 ∆2V T , with ∥∇θ Qθ (s, a)∥2 ≤ G for all (s, a).
Proof. See Appendix A.2. Theorem 4.1 has four parts. Part (i) shows that the estimator of the CV gradient is unbiased. Part (ii) reports an exact expression of the variance. Setting λ = 0 recovers real-only TD, whose variance (V[b]+σT2 )/n has two sources: the randomness of the real next state (σT2 ) and which state-action pairs happen to be in Dreal (V[b]). Because simulated next states are drawn independently of real ones, the simulator cannot reduce σT2 , it acts on V[b] only. There, V[b − λb̃] = V[b] − 2λ Cov(b, b̃) + λ2 V[b̃] is exactly the classical control-variate variance of Sec. 2 with f = b and h = b̃: The simulator’s 5
expected Bellman gradient is a control variate for the real one. The last two terms are the price of estimating E[b̃] and the simulator expectation from finitely many samples, and vanish in the abundant-simulation regime N, K → ∞. Part (iii) shows that, with a well-chosen λ, the CV gradient reduces the variance of real-only TD when Cov(b, b̃) ̸= 0. Part (iv) ties this gain to simulator quality: λ removes state-action variance at rate (1 − λ)2 and pays for the simulator value mismatch at rate λ2 . This is the key difference from sim-mixing. By Theorem 3.1, a mismatched simulator biases the sim-mixing solution. Here, the mismatch enters only the variance, scaled by 1/n and controlled by λ. 4.4
Practical Implementation of the CV Method
After the theoretical analysis of the CV loss we Algorithm 1 CV-Qmix now look into deriving a fully practical algorithm 1: Input: to optimize the objective (2). We summarize its 2: Dreal , Dsim main steps in Algorithm 1, which we refer to as 3: Classifier Pψ (x ∈ real | x) CV-Qmix in the remainder of the paper. In cases where we do not have access to w(s, a), it can be estimated using a subset of Dreal , Dsim . A large body of works have shown that this can be done in practice by training a classifier (e.g., [31]) P (x∈real|x) P π (s,a) where wψ (s, a) := Pψψ (x∈sim|x) ≈ Preal π (s,a) . sim
The classifier is trained by minimizing the cross entropy L (ψ) = −E log P (y = 1 | CE x∼D ψ real x) − Ex∼Dsim log Pψ (y = 0 | x) .
4: Learning rate ξ 5: Batch size B 6: EMA decay rates 0 ≤ τ1,2 ≤ 1 7: Initialize: 8: θ ∈ Rd , QT = Qθ , λ = 0 9: Compute D̃real 10: for i = 1 to T B 11: {x ∼ D̃real }B i=1 , {x ∼ Dsim }i=1 12: Compute LCV (θ) from (4) 13: Update θ ← θ − ξ∇LCV (θ) 14: Update θT ← τ1 θT + (1 − τ1 )θ 15: Update λ ← τ2 λ + (1 − τ2 )λ̂ 16: end for 17: Return Qθ
In addition, we observe that the CV loss in Eq. 2 can become unstable when state–action pairs that appear predominantly in the real dataset are overfit by the value function Qθ (s, a), leading to excessively negative contributions in the first expectation. To mitigate this issue, we apply zero masking, Im := I{wψ (x) < βw } to samples with large importance weights, effectively excluding simulator samples for which wψ (s, a) > βw . The masked loss: n N i i 1 Xh 1 X h real δθ (xi )2 − Im λ δθsim (xi )2 + Im λ wψ (s̃j , ãj ) δθsim (x̃j )2 (4) LCV (θ) = n i=1 N j=1 Importantly, the estimator is still unbiased (Apx. A.3) and, since the mask is a function of (s, a) only, Theorem 4.1 holds verbatim for the masked estimator, with b̃ and the simulator terms by Im . The mask also controls the importance-sampling term: Since multiplied π π EPsim Im w2 ∥∇θ (δθsim )2 ∥22 = EPreal Im w ∥∇θ (δθsim )2 ∥22 , for the mask computed with the true w 2 π we get σIS ≤ βw EPreal ∥∇θ (δθsim )2 ∥22 , whereas without masking it can be arbitrarily large when the two state-action distributions overlap poorly. We tune the mixing coefficient λ using the control variate formulation at the loss level rather than at the gradient level, as a cheap scalar surrogate of the λ⋆ in Theorem 4.1(iii). We find this approach to T be effective for gating simulated data. When updating the target network Q (s, a), we also update λ real 2 sim 2 sim 2 according to: λ̂ = Cov (δθ ) , (δθ ) /V (δθ ) .
5
Simulation-aided Policy Optimization
After analyzing the policy evaluation problem, we now shift the focus to policy optimization in simulation-aided RL. In this setting, we consider a class of parametric policies πϕ , where ϕ ∈ Rz . The typical goal is to learn a policy πϕ ϕ∗ ∈ arg maxϕ∈Rz Eµ [VPreal (s)] (5) from sampled interactions with the MDP Mreal . The interactions may come online by querying the MDP with a policy of our choice, or offline, in which data are gathered beforehand by running one or multiple policies in the MDP. 6
In modern algorithms, the optimization of the objective (5) is typically done by iterative gradient ascent updates over the current policy parameters ϕt or the current value parameters θt , from which the policy parameters are recovered later. In both settings, the policy evaluation step is crucial to either estimate the policy gradient [44, 15] or as the main target of the optimization [33, 20]. In the simulation-aided setting, we further access transitions coming from an imperfect simulator Msim , which we may use to improve the gradient estimates at each step. Especially, we aim to test whether our simulation-aided policy evaluation method can bring benefits to the corresponding policy optimization problem as well. We detail below how to incorporate Algorithm 1 as a policy evaluation building block in common actor-critic algorithms for the online and offline settings, respectively. 5.1
Online Policy Optimization
For the online setting, we use Soft Actor-Critic [SAC, 15] as a representative approach, although our Q estimation method can be easily incorporated in other popular algorithms, such as PPO [44] or TD3 [11]. To extend SAC to the simulation-aided setting, we just need to incorporate our Q estimation procedure in the critic update step and an additional sampling routine to collect fresh data from Msim with the current policy at each iteration. Crucially, SAC makes use of entropy regularization, so that we need to substitute in Algorithm 1 the standard TD error (1) with a soft Bellman error δθsoft (s, a, s′ ) := Qθ (s, a) − y where the target y is entropy-regularized with some α > 0, h i y = R(s, a) + γ Ea′ ∼πϕ (s′ ) QT (s′ , a′ ) − α log πϕ (a′ |s′ ) . 5.2
Offline Policy Optimization
Collecting data online with the current policy is often impractical in safety-critical and expensive domains, such as robotic manipulation or autonomous driving. In those settings, one would rather collect the data once and then iterate on the fixed dataset to learn a good policy. In the simulation-aided setting, we assume to have a pre-collected dataset from both the environment Mreal and its simulator Msim . Similarly as in the previous section, we want to extend popular offline RL algorithms with our Q estimation procedure. Here we chose Conservative Q-Learning [CQL, 20] as a representative example. Extending our method to the offline setting introduces two additional challenges. First, if the real and simulated datasets, Dreal and Dsim , are collected under different policies, then the π1 π2 induced state-action distributions Psim and Preal may have limited overlap. As a result, the masking mechanism and density ratio term w(s, a) (Eq. 4) may discard a large portion of the data. The high-overlap condition is naturally satisfied when both datasets are generated by the same behavior policy. While this coupling is straightforward to enforce in the online setting, it is more challenging offline, where real-world data may be collected under an unknown policy. In our current formulation, we assume access to the behavior policy. A practical instance of this setting arises when the behavior policy is trained in simulation and then used to collect real-world data. When incorporating simulated data into CQL, a second challenge arises from dataset imbalance. In particular, when the amount of simulated data is much larger than the real dataset (N ≫ n), the CQL regularization term can be dominated by simulated transitions, effectively under-regularizing the real data. To address this issue, we apply CQL regularization separately to the simulated and real datasets.
6
Experimental Results
We evaluate our method on standard MuJoCo continuous-control benchmarks [52], and on a custom MuJoCo robotics task, Puck Sliding, inspired by [39] (see Appendix G for details). To simulate the sim-to-real gap, we construct distinct real and simulated environments by perturbing physical parameters such as gravity, contact friction, joint damping, body part lengths, and actuator strength. Baselines. In all of the domains, we evaluate our approach, CV-Qmix, against several baselines. The most relevant are Reg-Qmix, a standard approach to mix sim and real data without correction (see Sec. 4.1), closely inspired by [8], and Real, which is a standard TD critic operating on real data only, corresponding to CV-Qmix with λ = 0. While these are policy evaluation methods, in policy optimization experiments we use the same algorithms’ names to refer to actor-critic methods in which the critic is implemented by CV-Qmix, Reg-Qmix, Real, respectively. The actor-critic backbone is 7
Figure 1: Simulation-aided policy evaluation on the Humanoid task. Simulation parameters (gravity tilt and magnitude) are perturbed relative to the real environment. Left: Normalized Q-value error of each mixing method as a function of the real-data budget. Middle: Effect of λ on CV-Qmix, including the adaptive choice of λ. Right: Effect of α on Reg-Qmix. In all plots, the real-only estimator is shown for reference. Curves show the mean and shaded regions ±1 std over 10 seeds. SAC [15] for online policy optimization and CQL [20] for offline policy optimization. In online policy optimization, we further compare against PAR [26] and VGDF [55], two strong baselines from the ODRL benchmark [27] (see Section 7 for details on how they work). Experiments. We first evaluate CV-Qmix on policy evaluation, the task it is designed to address, against Reg-Qmix and Real (Section 6.1, Figure 1). We further ablate the CV coefficient λ of CV-Qmix and the mixing coefficient α of Reg-Qmix (Figure 1 center, right). We then test whether these gains carry over to online and offline policy optimization (Section 6.2, Figure 2 3). Throughout, we vary the sim gap, i.e., how far the simulator’s dynamics parameters are shifted from those of Mreal : a larger gap corresponds to a larger shift and therefore a more biased simulator (exact values in Apx C.3). Additional results on robustness to increasing sim gaps and on the values of the adaptive λ are reported in Apx. B and D. 6.1
Policy Evaluation Experiments
We evaluate on the MuJoCo Humanoid task, where Mreal uses the default dynamics and Msim perturbs the gravity magnitude and tilt (Appendix C.3). We report the normalized Q-value error: the mean absolute error between the Monte Carlo Q-values predicted by the methods and ground-truth Q-values, after min-max normalizing both by the range of the ground-truth returns. To obtain groundtruth values, we construct a test set of state–action pairs (s, a) and estimate the Q-value of each pair under the evaluation policy by averaging the returns of 10 rollouts from (s, a) in Mreal . Figure 1 (left) shows that CV-Qmix outperforms the real-only estimator at every real-data budget. At the smallest budget, Reg-Qmix attains the lowest error, but CV-Qmix overtakes it beyond roughly 2,000 samples and, unlike Reg-Qmix, keeps improving and plateaus at a lower error as real data grows. The Reg-Qmix ablation (right) shows why naive mixing falls short. A high simulated-data ratio (α = 0.8) reduces error when real data is scarce but plateaus above the real-only baseline, whereas a low ratio (α = 0.2) tracks the baseline closely: more simulated data trades variance for bias. In contrast, CV-Qmix uses simulated data to reduce the variance of the real-data estimator while correcting for the simulator’s bias. As Theorem 4.1 shows, the variance is quadratic in λ and therefore minimized at an intermediate value. In this experiment, λ = 0.8 performs best (middle), and the adaptive estimate of λ (Section 4.4) comes close to this best fixed value. 6.2
Policy Optimization Experiments
We evaluate how improved policy evaluation can benefit policy optimization, both online and offline, in variety of MuJoCo domains, Ant, Walker, Hopper, and Puck Sliding. Online policy optimization. Figure 2 shows the results. In this experiment, all policies are pretrained in simulation with SAC, and then fine-tuned using both simulated and real data (except the Real baseline) with SAC equipped with the corresponding critic. The simulator and real environment differ in their dynamics parameters at three gap levels (small, medium, and large; see Appendix C.3 for dynamics shift details). The plots report the performance of the fine-tuning stage. As we can see, CV-Qmix performs better or on par with the most competitive baseline across all the gap levels, with the benefit of CV-Qmix approach increasing with larger sim gaps. On Ant, CV-Qmix is comparable 8
Figure 2: Policy finetuning with biased simulation data mixing. Comparing CV-Qmix (ours) and Reg-Qmix to other off-dynamics methods on Ant and Walker2D tasks across different simulation to real gaps. The policies were pre-trained on the simulation and then transferred to the real environment for fine-tuning with mixed simulation and real data. Each plot shows the mean ± std of 5 seeds. to other baselines at small and medium gap levels, but on the large gap it clearly outperforms all the baselines, with the margin growing with the gap. On Walker2D, the methods are comparable at small and medium gaps, while at a large gap Reg-Qmix and PAR degrade and CV-Qmix remains the best together with VGDF. These results are consistent with bias correction becoming important as the gap grows. It is interesting to take a closer look at ODRL baselines. PAR closely tracks Reg-Qmix: both train on mixed data, and PAR’s reward penalty does not remove the bias of simulated TD targets. VGDF avoids this bias, by filtering out simulation samples, but filtering too much simulated samples costs sample efficiency. In figure 3 (left), we test whether simulated data enables more policy updates, performing 10× more updates per real interaction. Mreal uses the default MuJoCo dynamics and Msim uses perturbed dynamics (Appendix C.3). Figure 3 compares Reg-Qmix and CV-Qmix (ours) against standard SAC (Real), which uses only real samples. Both mixing methods outperform the baseline, but Reg-Qmix plateaus earlier and has higher variance. We attribute the higher variance to the instability of jointly minimizing the real and simulated expectations (Sec. 4.1), which is sensitive to the real data collected during training; CV-Qmix reduces the variance of the real expectation, giving more stable optimization. We attribute the earlier plateau and lower asymptotic performance of Reg-Qmix to simulator bias, which can lead the policy toward actions that are suboptimal in the real environment. Offline policy optimization. In the offline setting (Figure 3, right), we first train a behavioral policy in the simulator with SAC until it plateaus, then use it to collect Dreal and Dsim , with substantially more simulated than real data (Appendix C.1). We run CQL with a CV-Qmix, Reg-Qmix, and real only critic with those data. Since offline policies cannot be evaluated by interacting with the real environment during training, early stopping and model selection are difficult [22, 21]; we therefore report performance averaged over the last 50k of 200k update steps, summarized as box plots. CVQmix outperforms both Reg-Qmix and real-only training on the Hopper and Sliding tasks. These results highlight a further advantage of CV-Qmix in the offline setting: by reducing the variance of the learning process (most visibly on Hopper), it makes performance less sensitive to the choice of stopping point, which matters when early stopping and model selection are difficult.
7
Related Work
Off-dynamics RL. Our setting falls within off-dynamics RL [10], where a source and a target MDP differ only in their transition dynamics, and access to the target is limited while the source is cheap to query. Existing methods handle the dynamics mismatch per transition, by correcting, penalizing, or discarding source samples: DARC [10] corrects source rewards using domain classifiers, PAR [26] penalizes them by the representation mismatch across domains, and VGDF [55] discards source transitions whose value targets disagree with those expected under the target dynamics, a criterion 9
Figure 3: Policy optimization with mixed simulated data on Hopper and Puck Sliding. Simulator parameters (gravity, friction, and body part lengths) are perturbed relative to the real environment. The plots on the left show online optimization (mean ± std over 10 seeds), while the plots on the right show offline optimization (box plots over 10 seeds). closely related to our ∆2V T term. In contrast, we use simulation data to aid each policy update in the real environment: rather than discarding simulated samples or modifying their rewards, we exploit their correlation with real ones and correct their bias at the policy-evaluation level, through a control-variate formulation of the TD loss (1). We compare against PAR and VGDF in Section 6. Control variates in RL. Control variates (CV) are a standard variance-reduction tool in RL, e.g., baselines and action-dependent critics in policy-gradient methods [13]. In off-policy evaluation, the doubly robust (DR) estimator [17] combines importance-weighted returns with a learned value model as a CV. DR is designed to debias off-policy data, while we debias off-dynamics data. Moreover, DR applies the CV directly to the policy-evaluation objective, while we apply it to the squared TD error. Statistically, our approach is closer to prediction-powered inference [2], which combines many biased model predictions with a few ground-truth samples to obtain unbiased, lower-variance estimates; here, simulated transitions play the role of the biased predictions.
8
Conclusion
In this paper, we introduced the simulation-aided reinforcement learning and a control variates approach that exploits biased simulator data to reduce variance without negatively biasing the performance on the real environment. Applying control variates to the squared TD error with a stable importance-sampling correction enables seamless integration into both online and offline actor–critic methods. Theory shows that variance reduction improves as the simulator more closely matches the real dynamics. Experiments on MuJoCo tasks demonstrate improved sample efficiency and robustness over standard simulation mixing, especially large under dynamics mismatch. Notably, our approach is entirely focused on policy evaluation, which is then incorporated into policy optimization algorithms as a building block. Future works may extend our control variates approach to the policy gradient estimate, bringing variance reduction in both the actor-critic components. Another future direction may consider a similar control variates solution to the model-based RL approach, in which we aim to estimate the transition dynamics of the real environment by exploiting information coming from multiple biased simulators. Finally, our approach requires resetting the simulator to visited real states, and therefore does not directly apply in partially observable settings where the real states cannot be fully accessed [18, 48]. One natural resolution is to adapt our method to such settings by constructing an estimator that predicts the state from partial observations, in the spirit of [40, 42, 35], and to then reset the simulator according to this state-estimation. Curiously, [19] show that training such a predictor over the simulator enables to perform well on real partially-observable environments. While this is only one possible extension, it will be interesting to explore other alternative directions.
Acknowledgments OH and KYL acknowledge support from the Israel Science Foundation (grant No. 3109/24), and were also partially supported by the Israel PBC-VATAT. IS, MM and AT were funded by the European Union (ERC, Bayes-RL, 101041250). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency (ERCEA). Neither the European Union nor the granting authority can be held responsible for them. 10
References [1] Ilge Akkaya, Marcin Andrychowicz, Maciek Chociej, Mateusz Litwin, Bob McGrew, Arthur Petron, Alex Paino, Matthias Plappert, Glenn Powell, Raphael Ribas, et al. Solving Rubik’s cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019. [2] Anastasios N. Angelopoulos, Stephen Bates, Clara Fannjiang, Michael I. Jordan, and Tijana Zrnic. Prediction-powered inference. Science, 382(6671):669–674, 2023. [3] Leemon Baird. Residual algorithms: Reinforcement learning with function approximation. In International Conference on Machine Learning, 1995. [4] Yevgen Chebotar, Ankur Handa, Viktor Makoviychuk, Miles Macklin, Jan Issac, Nathan Ratliff, and Dieter Fox. Closing the sim-to-real loop: Adapting simulation randomization with real world experience. In International Conference on Robotics and Automation, 2019. [5] Xiaoyu Chen, Jiachen Hu, Chi Jin, Lihong Li, and Liwei Wang. Understanding domain randomization for sim-to-real transfer. In International Conference on Learning Representations, 2022. [6] Erwin Coumans and Yunfei Bai. PyBullet, a Python module for physics simulation for games, robotics and machine learning. https://github.com/bulletphysics/bullet3, 2016. [7] Christoph Dann, Gerhard Neumann, and Jan Peters. Policy evaluation with temporal differences: A survey and comparison. Journal of Machine Learning Research, 15:809–883, 2014. [8] Shirli Di-Castro, Dotan Di Castro, and Shie Mannor. Sim and real: Better together. In Advances in Neural Information Processing Systems, 2021. [9] Yuqing Du, Olivia Watkins, Trevor Darrell, Pieter Abbeel, and Deepak Pathak. Auto-tuned sim-to-real transfer. In International Conference on Robotics and Automation, 2021. [10] Benjamin Eysenbach, Swapnil Asawa, Shreyas Chaudhari, Sergey Levine, and Ruslan Salakhutdinov. Off-dynamics reinforcement learning: Training for transfer with domain classifiers. In International Conference on Learning Representations, 2021. [11] Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In International Conference on Machine Learning, 2018. [12] Davit Gogolashvili, Matteo Zecchin, Motonobu Kanagawa, Marios Kountouris, and Maurizio Filippone. When is importance weighting correction needed for covariate shift adaptation? arXiv preprint arXiv:2303.04020, 2023. [13] Shixiang Gu, Timothy Lillicrap, Zoubin Ghahramani, Richard E. Turner, and Sergey Levine. Q-Prop: Sample-efficient policy gradient with an off-policy critic. In International Conference on Learning Representations, 2017. [14] Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, et al. DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning. Nature, 645(8081):633–638, 2025. [15] Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. In International Conference on Machine Learning, 2018. [16] Jiawei Huang and Nan Jiang. From importance sampling to doubly robust policy gradient. In International Conference on Machine Learning, 2020. [17] Nan Jiang and Lihong Li. Doubly robust off-policy value evaluation for reinforcement learning. In International Conference on Machine Learning, 2016. [18] Leslie Pack Kaelbling, Michael L. Littman, and Anthony R. Cassandra. Planning and acting in partially observable stochastic domains. Artificial Intelligence, 101(1–2):99–134, 1998. 11
[19] Ashish Kumar, Zipeng Fu, Deepak Pathak, and Jitendra Malik. RMA: Rapid motor adaptation for legged robots. In Robotics: Science and Systems, 2021. [20] Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative Q-learning for offline reinforcement learning. In Advances in Neural Information Processing Systems, 2020. [21] Tom Le Paine, Cosmin Paduraru, Andrea Michi, Caglar Gulcehre, Konrad Zolna, Alexander Novikov, Ziyu Wang, and Nando de Freitas. Hyperparameter selection for offline reinforcement learning. arXiv preprint arXiv:2007.09055, 2020. [22] Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020. [23] Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. In International Conference on Learning Representations, 2016. [24] Ren-Rui Liu, Jun Fan, Lei Shi, and Zheng-Chu Guo. Unbounded density ratio estimation and its application to covariate shift adaptation. arXiv preprint arXiv:2603.29725, 2026. [25] Wenxing Liu, Hanlin Niu, Wei Pan, Guido Herrmann, and Joaquin Carrasco. Sim-and-real reinforcement learning for manipulation: A consensus-based approach. In International Conference on Robotics and Automation, 2023. [26] Jiafei Lyu, Chenjia Bai, Jingwen Yang, Zongqing Lu, and Xiu Li. Cross-domain policy adaptation by capturing representation mismatch. In International Conference on Machine Learning, 2024. [27] Jiafei Lyu, Kang Xu, Jiacheng Xu, Mengbei Yan, Jingwen Yang, Zongzhang Zhang, Chenjia Bai, Zongqing Lu, and Xiu Li. ODRL: A benchmark for off-dynamics reinforcement learning. In Advances in Neural Information Processing Systems, 2024. [28] Shie Mannor, Yishay Mansour, and Aviv Tamar. Reinforcement Learning: Foundations. Cambridge University Press, 2026. [29] Jan Matas, Stephen James, and Andrew J. Davison. Sim-to-real reinforcement learning for deformable object manipulation. In Conference on Robot Learning, 2018. [30] Bhairav Mehta, Manfred Diaz, Florian Golemo, Christopher J. Pal, and Liam Paull. Active domain randomization. In Conference on Robot Learning, 2019. [31] Aditya Menon and Cheng Soon Ong. Linking losses for density ratio and class-probability estimation. In International Conference on Machine Learning, 2016. [32] Alberto Maria Metelli, Matteo Papini, Nico Montali, and Marcello Restelli. Importance sampling techniques for policy optimization. Journal of Machine Learning Research, 21:1–75, 2020. [33] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing Atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. [34] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. [35] Robert J. Moss, Anthony Corso, Jef Caers, and Mykel J. Kochenderfer. BetaZero: Belief-state planning for long-horizon POMDPs using learned approximations. Reinforcement Learning Journal, 1:158–181, 2024. [36] Fabio Muratore, Christian Eilers, Michael Gienger, and Jan Peters. Data-efficient domain randomization with Bayesian optimization. IEEE Robotics and Automation Letters, 6(2): 911–918, 2021. 12
[37] NVIDIA Corporation. NVIDIA Isaac Sim documentation. omniverse.nvidia.com/, 2023. Accessed: 2026-05-06.
https://docs.isaacsim.
[38] Art B. Owen. Monte Carlo theory, methods and examples. https://artowen.su.domains/ mc/, 2013. [39] Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, et al. Multi-goal reinforcement learning: Challenging robotics environments and request for research. arXiv preprint arXiv:1802.09464, 2018. [40] Pascal Poupart and Craig Boutilier. Value-directed belief state approximation for POMDPs. In Conference on Uncertainty in Artificial Intelligence, 2000. [41] Martin L. Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming. John Wiley & Sons, 2014. [42] Nicholas Roy and Geoffrey J. Gordon. Exponential family PCA for belief compression in POMDPs. In Advances in Neural Information Processing Systems, 2002. [43] Fereshteh Sadeghi and Sergey Levine. (CAD)2 RL: Real single-image flight without a single real image. In Robotics: Science and Systems, 2017. [44] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. [45] Masashi Sugiyama, Matthias Krauledat, and Klaus-Robert Müller. Covariate shift adaptation by importance weighted cross validation. Journal of Machine Learning Research, 8:985–1005, 2007. [46] Richard S. Sutton. Learning to predict by the methods of temporal differences. Machine Learning, 3(1):9–44, 1988. [47] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. MIT Press, second edition, 2018. [48] Sebastian Thrun, Wolfram Burgard, and Dieter Fox. Probabilistic Robotics. MIT Press, 2005. [49] Gabriele Tiboni, Karol Arndt, and Ville Kyrki. DROPO: Sim-to-real transfer with offline domain randomization. Robotics and Autonomous Systems, 166:104432, 2023. [50] Gabriele Tiboni, Pascal Klink, Jan Peters, Tatiana Tommasi, Carlo D’Eramo, and Georgia Chalvatzaki. Domain randomization via entropy maximization. In International Conference on Learning Representations, 2024. [51] Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In IEEE/RSJ International Conference on Intelligent Robots and Systems, 2017. [52] Emanuel Todorov, Tom Erez, and Yuval Tassa. MuJoCo: A physics engine for model-based control. In IEEE/RSJ International Conference on Intelligent Robots and Systems, 2012. [53] Marcel Torne, Anthony Simeonov, Zechu Li, April Chan, Tao Chen, Abhishek Gupta, and Pulkit Agrawal. Reconciling reality through simulation: A real-to-sim-to-real approach for robust manipulation. In Robotics: Science and Systems, 2024. [54] Andrew Wagenmaker, Kevin Huang, Liyiming Ke, Kevin Jamieson, and Abhishek Gupta. Overcoming the sim-to-real gap: Leveraging simulation to learn to explore for real-world RL. In Advances in Neural Information Processing Systems, 2024. [55] Kang Xu, Chenjia Bai, Xiaoteng Ma, Dong Wang, Bin Zhao, Zhen Wang, Xuelong Li, and Wei Li. Cross-domain policy adaptation via value-guided data filtering. In Advances in Neural Information Processing Systems, 2023.
13
A
Proofs
A.1
Proof of Theorem 3.1
To prove the result, we write Eq [|VPπreal (s) − VPπsim (s)|] " # X X Preal (s′ |s, a)VPπreal (s′ ) − Psim (s′ |s, a)VPπsim (s′ ) ≤ γ Eq,π s′ ∈S
" = γ Eq,π
(6)
s′ ∈S
X
X Preal (s |s, a) VPπreal (s′ ) − VPπsim (s′ ) + VPπsim (s′ ) Preal (s′ |s, a) − Psim (s′ |s, a)
s′ ∈S
s′ ∈S
′
(7) "
X γRmax ≤ γ Eq |VPπreal (s) − VPπsim (s)| + Eq,π Preal (s′ |s, a) − Psim (s′ |s, a) (1 − γ) ′
# (8)
s ∈S
P P by applying the Bellman equation V π (s) = a∈A π(a|s) R(s, a) + γ s′ ∈S P (s′ |s, a)V π (s′ ) π π to both P VPrealπ (s) and′ VPsim (s) to obtain (6), by summing and subtracting γ to obtain (7), by exploiting |a + b| ≤ |a| + |b|, PEq,π [ s′ ∈S ′VPsim Preal (s |s, a)] π P (s |s, a) = 1, V (s) ≤ Rmax /(1 − γ), and stationarity of q to obtain (8), ′ real Psim s ∈S from which the result follows. A.2
Proof of Theorem 4.1
Proof. Throughout the proof, θ and the target network are fixed, and all gradients are taken with π π respect to θ with V T treated as a constant. We assume that Preal is absolutely continuous w.r.t. Psim , so that the density ratio w is well defined, and that all the second moments appearing below are finite. π Notation. A sample of D̃real is x = (s, a, s′ , s̃′1 , . . . , s̃′K ), where (s, a) ∼ Preal , s′ ∼ Preal (s, a), ′ ′ ′ and s̃1 , . . . , s̃K are drawn i.i.d. from Psim (s, a), independently of s given (s, a). A sample of Dsim π is x̃ = (s̃, ã, s̃′ ), where (s̃, ã) ∼ Psim and s̃′ ∼ Psim (s̃, ã). In (3), the simulated Bellman error is computed with the empirical average of the simulated next-state values, K
δθsim (x) := Qθ (s, a) − r(s, a) + γ V̄K (x) ,
V̄K (x) :=
1 X T ′ V (s̃k ), K k=1
and δθsim (x̃) is defined analogously with the single next state s̃′ (i.e., K = 1). We also denote the expected next-state values as µreal (s, a) := Es′ ∼Preal (s,a) V T (s′ ) , µsim (s, a) := Es̃′ ∼Psim (s,a) V T (s̃′ ) , so that b(s, a) = 2 Qθ (s, a) − r(s, a) − γ µreal (s, a) ∇θ Qθ (s, a), b̃(s, a) = 2 Qθ (s, a) − r(s, a) − 2 π γ µsim (s, a) ∇θ Qθ (s, a), and ∆2V T = Es,a∼Preal µreal (s, a) − µsim (s, a) . Preliminary: conditional expectations of the gradients. Since V T is treated as a constant, ∇θ δθreal (x) = ∇θ δθsim (x) = ∇θ Qθ (s, a), and therefore ∇θ δθreal (x)2 = 2 δθreal (x) ∇θ Qθ (s, a),
∇θ δθsim (x)2 = 2 δθsim (x) ∇θ Qθ (s, a).
(9)
Both gradients are linear in the corresponding TD error. Since Qθ (s, a), r(s, a) and ∇θ Qθ (s, a) are fixed given (s, a), taking conditional expectations in (9) gives E ∇θ δθreal (x)2 s, a = 2 Qθ (s, a) − r(s, a) − γ E[V T (s′ ) | s, a] ∇θ Qθ (s, a) = b(s, a), (10) E ∇θ δθsim (x)2 s, a = 2 Qθ (s, a) − r(s, a) − γ E[V̄K (x) | s, a] ∇θ Qθ (s, a) = b̃(s, a), (11) where (11) uses E[V̄K (x) | s, a] = µsim (s, a), which holds for every K ≥ 1. In particular, (11) also sim 2 holds for the samples of Dsim (K = 1), i.e., E ∇θ δθ (x̃) s̃, ã = b̃(s̃, ã). 14
#
Proof of (i). Since the samples within each dataset are i.i.d., by linearity of expectation we write E[ĝλ ] = Ex ∇θ δθreal (x)2 − λ ∇θ δθsim (x)2 + λ Ex̃ w(s̃, ã) ∇θ δθsim (x̃)2 π π = Es,a∼Preal b(s, a) − λ b̃(s, a) + λ Es,a∼Psim w(s, a) b̃(s, a) (12) π π π = Es,a∼Preal b(s, a) − λ Es,a∼Preal b̃(s, a) + λ Es,a∼Preal b̃(s, a) (13) π = Es,a∼Preal b(s, a) , by applying the tower property together with (10)–(11) to obtain (12), and the definition of the density ratio to obtain (13) as X π P π (s, a) π π Es,a∼Psim w(s, a) b̃(s, a) = Psim (s, a) real b̃(s, a) = Es,a∼Preal b̃(s, a) . π Psim (s, a) (s,a)
The right-hand side does not depend on λ, hence E[ĝλ ] =E[ĝ0 ]. Finally, by (9) and the tower property, ′ ′ 2 π [b(s, a)] = Eπ,P Es,a∼Preal 2 δ (s, a, s ) ∇ Q (s, a) = ∇ E δ (s, a, s ) , which is the θ θ θ θ π,Preal θ real gradient of the TD objective (1) with the target network held fixed. Pn PN λ Proof of (ii). We write ĝλ = n1 i=1 u(xi ) + N j=1 v(x̃j ), where u(x) := ∇θ δθreal (x)2 − λ ∇θ δθsim (x)2 ,
v(x̃) := w(s̃, ã) ∇θ δθsim (x̃)2 .
The vectors u(x1 ), . . . , u(xn ), v(x̃1 ), . . . , v(x̃N ) are independent, the u(xi ) are identically distributed, and so are the v(x̃j ). Hence, all the cross terms E⟨u(xi ) − E u, u(xi′ ) − E u⟩ for i ̸= i′ , E⟨v(x̃j ) − E v, v(x̃j ′ ) − E v⟩ for j ̸= j ′ , and E⟨u(xi ) − E u, v(x̃j ) − E v⟩ vanish, and 1 λ2 1 λ2 2 V[u(x)] + V[v(x̃)] = V[u(x)] + σ , (14) n N n N IS 2 where the last equality follows from the definition of σIS . It remains to compute V[u(x)]. By the law of total variance, h i 2 π V[u(x)] = Es,a∼Preal E[u(x) | s, a] − E[u(x)] 2 h i π + Es,a∼Preal E ∥u(x) − E[u(x) | s, a]∥22 s, a , (15) where the cross term vanishes since E u(x) − E[u(x) | s, a] s, a = 0. V[ĝλ ] =
For the first term of (15), by (10)–(11) we have E[u(x) | s, a] = b(s, a) − λ b̃(s, a) and E[u(x)] = π [b(s, a) − λ b̃(s, a)], so that the first term equals V[b − λb̃], with b, b̃ evaluated at (s, a) ∼ Es,a∼Preal π Preal . For the second term of (15), by (9) and the definition of the TD errors, we write u(x) − E[u(x) | s, a] = 2 δθreal (x) − E[δθreal (x) | s, a] ∇θ Qθ (s, a) − 2λ δθsim (x) − E[δθsim (x) | s, a] ∇θ Qθ (s, a) = −2γ V T (s′ ) − µreal (s, a) − λ V̄K (x) − µsim (s, a) ∇θ Qθ (s, a). (16) Taking the squared norm of (16) and the conditional expectation, we obtain E ∥u(x) − E[u(x) | s, a]∥22 s, a h i 2 = 4γ 2 ∥∇θ Qθ (s, a)∥22 E V T (s′ ) − µreal (s, a) − λ V̄K (x) − µsim (s, a) s, a = 4γ 2 ∥∇θ Qθ (s, a)∥22 Vs′ ∼Preal (s,a) V T (s′ ) + λ2 V V̄K (x) | s, a (17) λ2 = 4γ 2 ∥∇θ Qθ (s, a)∥22 Vs′ ∼Preal (s,a) V T (s′ ) + Vs̃′ ∼Psim (s,a) V T (s̃′ ) , (18) K where we obtain (17) since s′ and s̃′1 , . . . , s̃′K are independent given (s, a), so that the cross term vanishes, E (V T (s′ ) − µreal (s, a))(V̄K (x) − µsim (s, a)) s, a = E V T (s′ ) − µreal (s, a) s, a E V̄K (x) − µsim (s, a) s, a = 0, 15
and we obtain (18) since V̄K (x) is the average of K i.i.d. samples of V T (s̃′ ) with s̃′ ∼ Psim (s, a). π Taking the expectation of (18) over (s, a) ∼ Preal , the second term of (15) equals σT2 + λ2 σ̃T2 /K by 2 2 the definitions of σT and σ̃T . Plugging both terms into (15), and then into (14), gives (ii). Proof of (iii). By expanding the squared norm in the definition of the variance, we have 2
V[b − λb̃] = E (b − E b) − λ(b̃ − E b̃) 2 = V[b] − 2λ Cov(b, b̃) + λ2 V[b̃]. 2 Plugging it into (ii) and denoting C := Cov(b, b̃) and D := V[b̃] + σ̃T2 /K + n σIS /N , we obtain
n V[ĝλ ] = V[b] + σT2 − 2λ C + λ2 D.
(19)
If D > 0, the right-hand side of (19) is a strictly convex quadratic function of λ. Setting its derivative −2C + 2λD to zero gives the minimizer λ⋆ = C/D, and substituting it back into (19) gives n V[ĝλ⋆ ] = V[b] + σT2 −
C2 . D
(20)
Setting λ = 0 in (19) gives n V[ĝ0 ] = V[b] + σT2 , the variance of real-only TD. Since C 2 /D ≥ 0, we conclude V[ĝλ⋆ ] ≤ V[ĝ0 ], with equality if and qonly if C = 0. If instead D = 0, then V[b̃] = 0 and, by the Cauchy–Schwarz inequality, |C| ≤ V[b] V[b̃] = 0, so that (19) does not depend on λ and the claim holds trivially (with λ⋆ := 0). Finally, the Cauchy–Schwarz inequality also gives C 2 ≤ V[b] V[b̃] ≤ V[b] D, so that (20) is bounded from below by σT2 : no choice of λ reduces the variance below the real transition noise. Proof of (iv). We write b − λb̃ = (1 − λ) b + λ (b − b̃). For any random vectors X, Y , applying ∥x + y∥22 ≤ 2∥x∥22 + 2∥y∥22 to x = X − E X and y = Y − E Y and taking expectations gives V[X + Y ] ≤ 2 V[X] + 2 V[Y ]. With X = (1 − λ) b and Y = λ (b − b̃), we get V[b − λb̃] ≤ 2(1 − λ)2 V[b] + 2λ2 V[b − b̃].
(21)
At each (s, a), the terms Qθ (s, a), r(s, a) and ∇θ Qθ (s, a) are the same in b and b̃, so that they cancel in the difference, giving b(s, a) − b̃(s, a) = 2γ µsim (s, a) − µreal (s, a) ∇θ Qθ (s, a). (22) Then, we write 2
π V[b − b̃] ≤ Es,a∼Preal b(s, a) − b̃(s, a) 2 h i 2 π = 4γ 2 Es,a∼Preal µreal (s, a) − µsim (s, a) ∥∇θ Qθ (s, a)∥22 h 2 i π ≤ 4γ 2 G2 Es,a∼Preal µreal (s, a) − µsim (s, a) = 4γ 2 G2 ∆2V T ,
(23) (24) (25)
by exploiting V[X] = E ∥X∥22 − ∥ E X∥22 ≤ E ∥X∥22 to obtain (23), by (22) and ∥c z∥22 = c2 ∥z∥22 for a scalar c to obtain (24), and by ∥∇θ Qθ (s, a)∥2 ≤ G for all (s, a), together with the definition of ∆2V T , to obtain (25). Plugging (25) into (21) gives (iv). A.3
Proof of Unbiased Gradients with Masking
Proof. For the masked loss version we have E[ĝλ ] = E ∇θ δθreal (x)2 − λIm ∇θ δθsim (x)2 + E λIm w(s̃, ã)∇θ δθsim (x̃)2 . By definition of the density ratio w(s, a), we have π π Ex̃∼Psim w(s̃, ã)Im ∇θ δθsim (x̃)2 = Ex∼Preal Im ∇θ δθsim (x)2 . Therefore, the simulator terms cancel, yielding E[ĝλ ] = E ∇θ δθreal (x)2 . This is exactly the gradient of the squared TD error objective, implying that ĝλ is an unbiased estimator. 16
Figure 4: Policy optimization robustness to simulation bias. Comparison of data-mixing strategies under increasing dynamics mismatch for Ant and Walker2D tasks. Simulator parameters (friction, joint armature, joint damping) are perturbed relative to the real environment. Showing online optimization (mean ± std over 5 seeds).
B
Robustness to Simulation Bias Experiment
We study the behavior of simulation mixing methods across a range of sim-to-real gaps, by progressively increasing the deviation of simulator parameters from the real environment. To this end, we use the online SAC variant in which, for both mixing methods (Reg-Qmix and CV-Qmix), we conservatively perform one policy update per real environment interaction, while incorporating a large number of additional interactions using simulated data. In these experiments, we additionally evaluate the MuJoCo Ant and Walker2D tasks. For the Ant task, we reduce the motor strength in the real environment to 30% of its default value. In our testing we observed that lowering motor strength of Ant amplifies the effect of dynamics mismatches, making performance degradation under sim-to-real transfer more pronounced, creating a meaningful bias for evaluation. In this experiment, we vary joint damping, armature, and joint friction to construct simulators with progressively increasing dynamics mismatch relative to Mreal (from left to right in Fig. 4). For exact experiments setup details see appendix C.3. Across both tasks, when Msim is close to Mreal , both regular mixing and CV mixing improve policy performance relative to training on real data alone. However, as the dynamics mismatch increases, regular mixing degrades performance, whereas CV mixing remains comparable to the real-only baseline. These results highlight the robustness of CV mixing, which mitigates the introduction of simulator-induced bias that can otherwise destabilize the optimization process.
17
C
Experiments Setup
C.1
Training Hyper parameters
Table 1: Walker2D and Ant robustness experiment Hyperparameters
Table 3: Sliding: Behavioral Policy Training in Simulation
Hyperparameter Walker2D-v5 Ant-v5 critic learning rate 0.0003 0.0003 policy learning rate 0.0003 0.0003 real step frequency 1 1 batch size real 128 128 batch size sim 128 128 replay buffer size real 100000 100000 replay buffer size sim 11000000 11000000 sim step frequency 1 1 num steps in sim 10 10 critic update frequency 1 1 target network update frequency 1 1 τ 0.005 0.005 γ 0.99 0.99 policy update frequency 2 2 policy update steps 2 2 classifier update frequency 10 10 classifier update steps 10 10 classifier learning rate 0.0003 0.0003 classifier batch size 128 128 initial λ 0 0 λ decay 0.001 0.001 SAC α 0.05 0.2 CV mask β 3.0 3.0
Hyperparameter critic learning rate policy learning rate SAC α batch size replay buffer size critic update frequency target network update frequency τ γ policy update frequency policy update steps total steps
Value 0.0003 0.0003 0.05 128 100000 1 1 0.005 0.99 2 2 300000
Table 4: Hopper: Behavioral Policy Training in Simulation Hyperparameter Value critic learning rate 0.0003 policy learning rate 0.0003 SAC α 0.2 batch size 128 replay buffer size 100000 critic update frequency 1 target network update frequency 1 τ 0.005 γ 0.99 policy update frequency 2 policy update steps 2 total steps 1000000
Table 2: Hopper and Sliding sample efficiency online SAC experiments Hyperparameters Hyperparameter Value critic learning rate 0.0003 policy learning rate 0.0003 real step frequency 10 batch size real 128 batch size sim 128 replay buffer size real 100000 replay buffer size sim 11000000 sim step frequency 1 num steps in sim 1 critic update frequency 1 target network update frequency 1 τ 0.005 γ 0.99 policy update frequency 2 policy update steps 2 classifier update frequency 10 classifier update steps 10 classifier learning rate 0.0003 classifier batch size 128 initial λ 0 λ decay 0.001 SAC α 0.05 CV mask β 3.0
Table 5: Offline CQL Training Hyperparameters Hyperparameter Sliding critic learning rate 0.0001 policy learning rate 0.0003 batch size real 128 batch size sim 128 replay buffer size real 20000 replay buffer size sim 1000000 critic update frequency 1 target network update frequency 1 τ 0.005 γ 0.99 policy update frequency 2 policy update steps 2 classifier subset split 0.3 classifier training steps 1000 classifier learning rate 0.0003 initial λ 0 λ decay 0.001 SAC α auto-tune CQL α 0.5 maximum CQL penalty gap 20 CV mask β 3.0
18
Hopper 0.0001 0.0003 128 128 2000 100000 1 1 0.005 0.99 2 2 0.3 1000 0.0003 0 0.001 0.2 0.5 20 3.0
C.2
Off-Dynamics finetuning benchmark Hyper parameters
Table 6: Real-only (SAC fine-tuning) Hyperparameters Hyperparameter
Walker2D-v5 Ant-v5
critic learning rate policy learning rate total real env steps real step frequency batch size real replay buffer size real learning starts critic update frequency target network update frequency τ γ policy update frequency policy update steps SAC α
0.0003 0.0003 100000 1 128 100000 25000 1 1 0.005 0.99 2 2 auto-tuned
Table 8: Reg-Qmix Hyperparameters
0.0003 0.0003 200000 1 128 100000 5000 1 1 0.005 0.99 2 2 0.2
Table 7: CV-Qmix Hyperparameters Hyperparameter
Walker2D-v5
Ant-v5
critic learning rate policy learning rate total update steps real step frequency sim step frequency num steps in sim critic batch size real critic batch size sim policy batch size real policy batch size sim replay buffer size real replay buffer size sim learning starts critic update frequency target network update frequency τ γ policy update frequency policy update steps critic grad-norm clip classifier update frequency classifier update steps classifier learning rate classifier weight decay classifier batch size classifier hidden layers / dim initial λ λ decay sim importance-ratio clip next-action samples CV mask β SAC α
0.0003 0.0003 1000000 5 1 100 64 256 128 64 100000 1000000 25000 1 1 0.005 0.99 2 2 50000 1 1 0.0003 0.2 128 2 / 256 0 0.001 [0, 3] 10 3.0 auto-tuned
0.0003 0.0003 1000000 5 1 100 64 256 128 64 100000 1000000 5000 1 1 0.005 0.99 2 2 50000 1 1 0.0003 0.2 128 2 / 256 0 0.001 [0, 3] 10 3.0 0.2
Hyperparameter
Walker2D-v5
Ant-v5
critic learning rate policy learning rate total update steps real step frequency sim step frequency num steps in sim critic batch size real critic batch size sim policy batch size real policy batch size sim replay buffer size real replay buffer size sim learning starts critic update frequency target network update frequency τ γ policy update frequency policy update steps mixing coefficient αmix SAC α
0.0003 0.0003 1000000 5 1 100 128 128 128 64 100000 1000000 5000 1 1 0.005 0.99 2 2 0.5 auto-tuned
0.0003 0.0003 1000000 5 1 100 128 128 128 64 100000 1000000 5000 1 1 0.005 0.99 2 2 0.5 0.2
Table 9: PAR Hyperparameters
19
Hyperparameter
Walker2D-v5
Ant-v5
critic learning rate policy learning rate total update steps real step frequency sim step frequency num steps in sim critic batch size real critic batch size sim policy batch size real policy batch size sim replay buffer size real replay buffer size sim learning starts critic update frequency target network update frequency τ γ policy update frequency policy update steps encoder learning rate encoder hidden dim representation dim (zs ) encoder update frequency encoder update steps encoder batch size reward penalty coefficient β SAC α
0.0003 0.0003 1000000 5 1 100 128 128 64 64 100000 1000000 5000 1 1 0.005 0.99 2 2 0.0003 256 256 200 1 128 1.0 auto-tuned
0.0003 0.0003 1000000 5 1 100 128 128 64 64 100000 1000000 5000 1 1 0.005 0.99 2 2 0.0003 256 256 200 1 128 1.0 0.2
Table 10: VGDF Hyperparameters
C.3
Hyperparameter
Walker2D-v5
Ant-v5
critic learning rate policy learning rate total update steps real step frequency sim step frequency num steps in sim batch size real batch size sim policy batch size replay buffer size real replay buffer size sim learning starts critic update frequency target network update frequency τ γ policy update frequency policy update steps actor-critic grad-norm clip dynamics ensemble size / elites dynamics hidden dim dynamics learning rate dynamics batch size dynamics train frequency dynamics holdout ratio likelihood gate threshold sim samples before gating optimistic exploration SAC α
0.0003 0.0003 1000000 5 1 100 128 128 128 100000 1000000 5000 1 1 0.005 0.99 2 2 100 7/5 200 0.001 256 250 0.1 0.75 100000 True auto-tuned
0.0003 0.0003 1000000 5 1 100 128 128 128 100000 1000000 5000 1 1 0.005 0.99 2 2 100 7/5 200 0.001 256 250 0.1 0.75 100000 True 0.2
MuJoCo environment setting Table 11: Hopper Task Parameters
Table 15: Walker2D Robustness Experiment Parameters
Parameter Real Small Gap Medium Gap Large Gap gravity -9.81 -8.82 -7.84 -6.86 floor friction 1.0 0.8 0.8 0.7 torso length 0.2 0.24 0.24 0.26
Parameter Real Small Gap Medium Gap Large Gap joint damping 1 1 1.5 2 joint friction 0.7 0.6 0.5 0.4
Table 12: Sliding Task Parameters
Table 16: Ant Robustness Experiment Parameters
Parameter Real Sim puck damping 0.2 0.24
Parameter Real Small Gap Medium Gap Large Gap joint armature 3 2.5 2 1.5 joint damping 2 2 1.5 1.5 joint friction 0.4 0.5 0.8 1
Table 13: Walker2D Finetuning Task Parameters Parameter
Sim
gravity tilt (deg) foot friction
0 1.9
Real Real Real (Small Gap) (Medium Gap) (Large Gap) 4 2.85
6 3.8
8 4.75
Table 14: Humanoid Policy Eval Task Parameter
Sim
Table 17: Ant Finetuning Task Parameters Parameter
Real Small Gap Medium Gap Large Gap
gravity tilt (deg) floor friction ankle motor gear torso CoM x-offset
0 1.0 150 0
-2.5 1.375 145 0.1
-5 1.75 140 0.2
-30 2.5 130 0.4
Real
gravity vector (0,0,-9.81) (-3, 0, -8)
D
Additional Implementation Details
To improve the stability of the practical CV loss (4) We clipped the loss value so it cannot be negative. In our experiments this helps the performance of CV-Qmix. Lclip CV (θ) = clip(LCV (θ), 0, ∞) 20
Sim Gap
Ant
Walker2D
Small Medium Large
0.37 ± 0.02 0.21 ± 0.01 0.08 ± 0.02
0.45 ± 0.06 0.32 ± 0.06 0.25 ± 0.05
Table 18: λ̂ values of CV-Qmix by simulation gap in the fine-tuning experiment. For each seed, λ̂ is averaged over the full training run; values are mean ± std over 5 seeds.
E
The role of λ in CV-Qmix
The learned adaptive coefficient λ also exhibited a clear relationship with the simulator mismatch (see table 18). when the simulator is strongly correlated with the real environment, the method assigns it a larger weight, whereas under a large mismatch the simulator contribution is automatically suppressed. This supports the interpretation of λ as both a diagnostic of real–sim correlation and a soft gating mechanism for simulated information.
F
Compute Resources
For all experiments, we used two NVIDIA L40S GPUs. The computational requirements of our method are modest, and the experiments can be run on standard GPUs with as little as 4GB of VRAM. Each experiment reported in the paper required approximately one day to complete.
G
Puck Sliding Environment
Figure 5: The environment consists of a two-link robotic arm that moves in the horizontal (x, y) plane, along with a puck that can slide on the surface. The objective is for the arm to strike the puck so that it reaches a target location on the plane, which is placed far from the robot. The puck, arms joints, target positions are randomized at each episode.
21
Related documents
- Improving Generalization and Robustness in Offline Reinforcement Learning via Boundary-Aware Data Augmentation#1034068
- Efficient Diffusion Policy Fine Tuning with Latent Noise Representation Bridging#1622809
- ReDiF: Resource-Efficient Few-Step Diffusion Distillation via Reinforcement Learning#1143656
- Fewer simulations, sharper covariances: Reducing mock covariance noise with Zeldovich approximation control variates#1423876
- RoboChemGym: A Protocol-Driven Generative Simulation Framework for Long-Horizon Chemical Manipulation#1187022
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive