Automatic Reward Design via Learning Motivation-Consistent Intrinsic Rewards

Yixiang Wang, Yujing Hu, Feng Wu, Yingfeng ChenarXiv 2022 · DOI

Introduction

Reinforcement Learning (RL) agents typically learn through trial and error to maximize a reward signal. However, in many real-world scenarios and complex games, these rewards are "sparse"—received only after a long sequence of correct actions. To address this, researchers often use manual reward shaping, adding "intrinsic" rewards for intermediate steps. This process is labor-intensive and prone to "reward hacking," where agents exploit loopholes in the reward function. This paper introduces Motivation-Based Reward Design (MBRD), an automated framework that generates dense intrinsic rewards by aligning them with sparse extrinsic goals.

Methodology: Motivation Alignment

The core innovation of MBRD is the concept of "motivation" ($z$), defined as the gradient of the expected cumulative reward with respect to the policy parameters. Essentially, motivation represents the direction a reward signal pushes the agent's behavior. Instead of matching numerical reward values, MBRD focuses on the angle between these motivation vectors.

The MBRD framework aligns intrinsic motivation ($Z^{in}$) with extrinsic motivation ($Z^{ex}$) by minimizing the angle between them.

The algorithm optimizes intrinsic reward parameters by maximizing the cosine similarity between the intrinsic motivation vector ($z_{in}$) and the extrinsic motivation vector ($z_{ex}$). This ensures that the internal goals created for the agent are mathematically consistent with the environment's ultimate objective. To simplify the search space, MBRD utilizes "game points"—discrete events like picking up an item—as features for the intrinsic reward function.

Experimental Evaluation

The researchers evaluated MBRD across five environments designed to test specific RL challenges:

  • Grid-World Domains: Including Foraging (delayed rewards), Hungry-Thirsty (exploration dependencies), and Fight Monster (long-term credit assignment).
  • MuJoCo Domains: Modified versions of Hopper-v2 and Swimmer-v2 with sparse, delayed rewards based on region-specific feedback.

Key Results and Insights

MBRD demonstrated significant improvements over standard baselines such as PPO, Count-Based exploration, and LIRPG. A key finding was the method's robustness to delays; by aligning motivations rather than immediate outcomes, MBRD effectively handles the time gap between actions and rewards.

Performance comparison across tasks shows MBRD (blue) achieving higher cumulative rewards and faster convergence than baselines like PPO and LIRPG.

In the Fight Monster task, MBRD was uniquely successful in learning the value of a weapon "buff" acquired long before the final encounter. Similarly, in the sparse Hopper-v2 task, MBRD reached a cumulative reward of ~1000, vastly outperforming the PPO baseline which struggled to exceed ~200. The results suggest that the scale of rewards is less critical than their directional consistency with the final goal.

Conclusion

MBRD offers a mathematically grounded approach to automatic reward design by prioritizing the alignment of behavioral motivations. While it currently relies on predefined "game points," future work aims to automate the detection of these features using unsupervised learning, potentially leading to a fully end-to-end reward design process.

Summary updated

BibTeX
@misc{wang2022automatic,
  author = {Yixiang Wang and Yujing Hu and Feng Wu and Yingfeng Chen},
  title = {{Automatic Reward Design via Learning Motivation-Consistent Intrinsic Rewards}},
  year = {2022},
  eprint = {2207.14722},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2207.14722},
}
Figure