Learning to Win, Lose and Cooperate through Reward Signal Evolution

Rafal Muszynski, Katja Hofmann, Jun WangarXiv 2021

Abstract

Designing effective reward signals is a fundamental challenge in Reinforcement Learning (RL), often requiring tedious manual engineering. This paper introduces a Reward Signal Evolution framework that automates the discovery of reward functions. By evolving simple spatial reward mappings in the game of Pong, the researchers demonstrate that evolved signals can drive complex behaviors—such as winning, losing, or cooperating—more effectively and stably than traditional score-based rewards. The results highlight that non-obvious environmental cues often serve as superior training signals compared to sparse, high-level goals.

Introduction

In Reinforcement Learning, the reward signal acts as the primary communication channel between the designer and the agent. However, translating a high-level objective (e.g., "win the game") into a scalar reward often leads to "reward hacking," where agents exploit loopholes in the reward function without achieving the intended goal. This "reward engineering" bottleneck limits the scalability of RL in complex environments. This study proposes bypassing manual design by treating the reward signal itself as an evolvable parameter optimized for high-level fitness functions.

Methodology

The authors developed the Reward Signal Evolution algorithm, a semi-evolutionary approach designed to keep the search space manageable while allowing for diverse behavioral discovery.

Spatial Reward Mapping

The Pong environment was divided into three vertical regions: $a_1$ (opponent's side), $a_2$ (middle), and $a_3$ (agent's side). A reward signal was represented as a 3-bit string (e.g., 100), where a 1 indicates the agent receives a reward whenever the ball is present in that specific region. This provides a dense feedback signal compared to the sparse reward of scoring a point.

The Evolutionary Loop

  1. Initialization: A population of agents is initialized, each assigned a unique 3-bit reward signal and trained using a Deep Q-Network (DQN).
  2. Evaluation: Periodically, agents are evaluated against high-level "goal functions":
  3. Winning: Maximizing total points scored.
  4. Losing: Maximizing total points lost.
  5. Cooperation: Maximizing volley duration without scoring.
  6. Selection and Mutation: The least successful reward signals are pruned, and new signals are generated via mutation to explore the reward space.

Key Results

Winning and Losing

For the goal of winning, the evolutionary process discovered that rewarding the agent when the ball was on the opponent's side (100) was highly effective. This signal achieved a peak score of 505 points at 9 million timesteps, outperforming traditional baselines. Conversely, the "Losing" objective was the simplest to evolve; the signal 001 (rewarding ball presence on the agent's own side) quickly taught the agent to avoid the ball entirely.

Performance of various 3-bit reward signals on the 'Winning' objective (total points won) over 9 million timesteps.

Cooperation

Fostering cooperation proved more nuanced. The evolved signal 110 (rewarding the ball in the opponent's side and the middle) led to significantly longer volleys than the hand-coded baseline b010, which only rewarded middle-court presence. The evolved agents learned to maintain active play by focusing on ball positioning rather than just avoiding the edges.

Performance of reward signals on the 'Cooperation' objective (volley duration) over time, showing the superiority of evolved signals like 110.

Discussion

A major insight from this work is the discovery of non-obvious rewards. Human designers typically focus on the final outcome (the score), but evolution favored signals tied to ball position. Because these spatial events occur every frame, they provide a much denser and more stable gradient for the DQN to follow, preventing the agent from getting stuck in local extrema.

Future Directions

While successful in a discrete 3-bit space, future research could expand this framework to continuous reward values or more complex spatial features. Additionally, combining reward evolution with Population-Based Training (PBT)—where both the reward and the opponent evolve simultaneously—could lead to even more robust and sophisticated agent behaviors in competitive and cooperative settings.

Summary updated

BibTeX
@misc{muszynski2021learning,
  author = {Rafal Muszynski and Katja Hofmann and Jun Wang},
  title = {{Learning to Win, Lose and Cooperate through Reward Signal Evolution}},
  year = {2021},
  eprint = {2105.08187},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.08187},
}
Figure