Simulation-aided Reinforcement Learning with Control Variates

Omer Hemo, Ido Sefi, Mirco Mutti, Aviv Tamar, Kfir Y. Levy

TL;DR

This paper introduces a novel way to use biased simulation data to accelerate real-world reinforcement learning (RL) without inheriting the simulator's inaccuracies. By treating simulated data as a control variate to reduce the variance of real-world updates rather than a direct source of truth, the authors achieve faster, more stable learning that is robust to significant "sim-to-real" gaps.

What Problem Does This Paper Address?

Reinforcement Learning is notoriously data-hungry. While we can generate millions of samples in a simulator for pennies, those simulators are rarely "perfect." Differences in friction, gravity, or sensor noise—the infamous sim-to-real gap—mean that a policy optimized in simulation often fails in the physical world.

The standard industry fix is "sim-mixing": simply training on a blend of real and simulated data. However, if the simulator is biased, this approach can actually pull the agent away from the optimal real-world policy. Alternatively, techniques like Importance Sampling can fix the bias but often introduce massive variance, making training unstable. The authors ask: Can we exploit biased but abundant simulation data to improve real-world performance without suffering from simulator-induced bias?

Methods

The core idea is to apply Control Variates (CV), a classic statistical variance-reduction technique, to the Temporal Difference (TD) error used in policy evaluation.

In a standard statistical setting, if you want to estimate a quantity $X$ (real-world data) and you have a correlated variable $Y$ (simulated data) with a known expectation, you can form a new estimator: $Z = X - \lambda(Y - E[Y])$. This new estimator $Z$ is unbiased but has lower variance if $X$ and $Y$ are highly correlated.

The authors translate this into RL via an algorithm called CV-Qmix:

  1. Unbiased Learning Target: Unlike standard mixing, the learning target remains anchored to real-world transitions.
  2. Variance Reduction: Simulated transitions are used to "correct" the real-world gradients. If the simulator's behavior correlates with the real world, it dampens the noise in the real-world samples.
  3. Adaptive Gating: They introduce an adaptive coefficient $\lambda$ that automatically scales the simulator's influence. If the simulator is a poor match for reality, $\lambda$ shrinks, and the algorithm safely reverts to standard real-only RL.
  4. Density Ratio Masking: To handle cases where the simulator and real-world distributions don't overlap well, they use a classifier-based masking system to filter out unreliable simulated samples.
Algorithm 1: CV-Qmix

Datasets

The researchers evaluated their approach on several standard and custom continuous-control tasks using the MuJoCo physics engine:

  • Standard Benchmarks: Humanoid, Ant, Walker2D, and Hopper.
  • Custom Task: "Puck Sliding," where a two-link robotic arm must strike a puck to reach a target.
  • Sim-to-Real Setup: To create a controlled "bias," they perturbed physical parameters (gravity, friction, joint damping, etc.) between the "real" environment and the "simulator." They tested across three gap levels: small, medium, and large.

Key Insights and Ideas

  • Embracing Bias: Most sim-to-real research tries to fix the simulator or make the policy robust to its errors. This paper suggests we should instead "embrace" the bias—using the simulator's correlation with reality as a tool for stability, even if its absolute values are wrong.
  • The "Soft Gate" Effect: The adaptive $\lambda$ is a major "aha" moment. It acts as a diagnostic tool; in experiments, $\lambda$ was consistently higher for small sim-to-real gaps and lower for large ones, effectively "gating" the simulated information based on its utility.
  • Robustness to Mismatch: Naive sim-mixing (Reg-Qmix) performs well when the simulator is accurate but degrades quickly as the sim-to-real gap grows. CV-Qmix remains robust, often matching or exceeding the performance of training on real data alone, even with a highly inaccurate simulator.

Key Results

  • Policy Evaluation Accuracy: In the Humanoid task, CV-Qmix achieved significantly lower normalized Q-value error compared to real-only data and standard mixing, especially as the real-world data budget increased.
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.
  • Online Performance: On the Ant and Walker2D tasks, CV-Qmix outperformed strong baselines like PAR and VGDF. The advantage was most pronounced at the "large gap" level, where other methods often failed to improve over the real-only baseline.
  • Offline Stability: In offline RL (using the CQL framework), CV-Qmix showed much lower variance in performance across different tasks, making it less sensitive to the choice of stopping point during training—a notorious difficulty in offline settings.

Limitations and Future Work

  • Simulator Resets: The current method requires the ability to "reset" the simulator to specific states encountered in the real world. While common in many physics engines (like MuJoCo or Isaac Sim), this isn't always possible in all simulation environments.
  • Partial Observability: The theory assumes full state access. Extending this to partially observable settings (POMDPs), where the agent only has noisy sensor data, would require integrating state estimation.
  • Beyond Value Functions: The authors focused on policy evaluation (the "critic"). A logical next step is applying control variates directly to the policy gradient (the "actor") to further reduce variance in the optimization step itself.

Summary updated

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.
BibTeX
@inproceedings{hemo2026simulation,
  author = {Omer Hemo and Ido Sefi and Mirco Mutti and Aviv Tamar and Kfir Y. Levy},
  title = {{Simulation-aided Reinforcement Learning with Control Variates}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=VYeUnrk9Ch},
}
Figure