Simple Noisy Environment Augmentation for Reinforcement Learning

Raad Khraishi, Ramin OkhratiarXiv 2023

TL;DR

This paper introduces a suite of generic "noisy wrappers" that augment Reinforcement Learning (RL) environments by injecting randomness into states, rewards, and transition dynamics. By introducing a "noise rate" hyperparameter to control the frequency of these perturbations, the authors demonstrate significant improvements in return and sample efficiency across standard MuJoCo benchmarks without needing to modify the underlying RL algorithms.

What Problem Does This Paper Address?

In the world of Computer Vision and Natural Language Processing, data augmentation (like flipping images or swapping words) is a standard tool for improving model robustness and generalization. In Reinforcement Learning, however, augmentation has primarily focused on image-based tasks (e.g., random crops for agents learning from pixels).

There is a significant gap in general-purpose augmentation techniques for "low-dimensional" or non-image RL problems—the kind found in finance, manufacturing, and robotics. Agents in these domains often struggle to explore effectively or overfit to the specific dynamics of their training environment. The authors tackle this by asking: Can we improve RL performance simply by wrapping the environment in a layer of controlled noise?

Methods

The authors propose using environment wrappers—modular components that sit between the agent and the environment—to inject noise. This approach is "algorithm-agnostic," meaning it works with any RL agent (like SAC, PPO, or TD3) without changing its internal code.

They categorize their augmentations into three areas:

  1. State Space Noise: Techniques like adding Gaussian/Uniform noise to observations, "mixup" (blending current and previous observations), and "dropout" (randomly zeroing out parts of the state).
  2. Reward Space Noise: Adding noise to the reward signal. They introduce a novel technique, RandomUniformScaleReward, which scales the reward by a random factor (e.g., multiplying by a value between 0.5 and 1.5).
  3. Transition Dynamics Noise: They introduce RandomEarlyTermination, a novel wrapper that randomly ends training episodes earlier than the environment's standard horizon to force the agent to adapt to varying episode lengths.

Crucially, they introduce a noise rate ($p$) hyperparameter. Instead of applying noise at every single time step, the wrapper only injects noise with probability $p$. This allows for fine-grained control over how much "chaos" the agent experiences.

Datasets

The techniques were evaluated on five continuous control tasks from the MuJoCo suite within the OpenAI Gym framework:

  • HalfCheetah-v2
  • Hopper-v2
  • Humanoid-v2
  • Pusher-v2
  • Walker2d-v2

These environments vary in complexity, from the relatively simple Hopper to the high-dimensional Humanoid.

Key Insights and Ideas

  • The "Less is More" Noise Principle: One of the most important findings is that applying noise 100% of the time ($p=1.0$) is rarely the best strategy. Often, low noise rates (like $p=0.05$ or $p=0.01$) yielded the highest performance gains. This suggests that occasional perturbations are enough to encourage exploration without completely drowning out the learning signal.
  • Algorithm-Specific "Tastes": Different RL algorithms respond better to different types of noise. For example, PPO showed a strong preference for reward-space noise, while TD3 performed better with observation-space noise.
  • Boosting Sample Efficiency: Noise isn't just about higher final scores; it can make learning much faster. In several tests, agents trained with noise reached the baseline's final performance in less than half the number of training steps.
  • Variance Reduction: Surprisingly, adding noise to the environment sometimes reduced the variance of the agent's performance across different random seeds, leading to more stable and reliable training.

Key Results

The best-performing noisy wrappers provided substantial boosts over the unaugmented baselines:

  • PPO: Saw a maximum increase in return of approximately 90% on Walker2d-v2.
  • SAC: Achieved a 34% improvement on Humanoid-v2.
  • TD3: Showed more modest but consistent gains, such as a 19% improvement on Hopper-v2.

The novel RandomUniformScaleReward (0.5, 1.5) emerged as a particularly versatile tool, providing consistent performance improvements for all three algorithms tested.

Learning curves for SAC with RandomUniformScaleReward across different noise rates. Note how even low noise rates (0.01, 0.05) often outperform the 0.0 baseline.

Limitations and Future Work

While effective, these noisy wrappers are not a "set and forget" solution. The authors note several challenges:

  • Hyperparameter Sensitivity: The effectiveness of a wrapper is highly dependent on the choice of noise type, the noise rate ($p$), and the specific parameters of the noise itself (like the standard deviation of Gaussian noise).
  • Potential for Instability: In some instances, poorly chosen noise settings significantly increased performance variance or even led to worse results than the baseline.
  • Future Directions: The authors suggest that future research should look into automated noise selection (similar to AutoAugment in computer vision) to remove the need for manual tuning. They also plan to explore combining multiple types of noise simultaneously and developing adaptive noise rates that change as the agent learns.

The wrappers are available for the community in the noisyenv repository.

Summary updated

BibTeX
@misc{khraishi2023simple,
  author = {Raad Khraishi and Ramin Okhrati},
  title = {{Simple Noisy Environment Augmentation for Reinforcement Learning}},
  year = {2023},
  eprint = {2305.02882},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.02882},
}
Figure