NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Maximizing the Total Reward via Reward Tweaking

Chen Tessler, Shie MannorarXiv 2020 · OpenReview

Abstract

In reinforcement learning, the discount factor $\gamma$ controls the agent's effective planning horizon. Traditionally, this parameter was considered part of the MDP; however, as deep reinforcement learning algorithms tend to become unstable when the effective planning horizon is long, recent works refer to $\gamma$ as a hyper-parameter -- thus changing the underlying MDP and potentially leading the agent towards sub-optimal behavior on the original task. In this work, we introduce reward tweaking. Reward tweaking learns a surrogate reward function $\tilde r$ for the discounted setting that induces optimal behavior on the original finite-horizon total reward task. Theoretically, we show that there exists a surrogate reward that leads to optimality in the original task and discuss the robustness of our approach. Additionally, we perform experiments in high-dimensional continuous control tasks and show that reward tweaking guides the agent towards better long-horizon returns although it plans for short horizons.

Introduction: The Planning Horizon Dilemma

Deep reinforcement learning (RL) agents are typically designed to maximize the total reward over a specific horizon. However, training these agents on long-horizon tasks presents a significant challenge. To ensure stable learning, practitioners often employ a discount factor ($\gamma$), which effectively reduces the agent's planning horizon by prioritizing immediate rewards over distant ones.

This practice introduces a fundamental trade-off, often referred to as a "catch-22" in RL optimization:

  1. The Region of Blackwell Sub-optimality: When $\gamma$ is low, the planning horizon is short. While learning is stable, the agent becomes "myopic," ignoring long-term consequences and failing to reach the global optimum of the original task.
  2. The Region of Network Instability: When $\gamma$ is high (approaching 1.0), the agent considers long-term goals, but the learning process becomes increasingly noisy and unstable due to high variance in value estimates.
The trade-off between planning horizon and performance. Standard RL struggles between sub-optimal myopic behavior at low $\gamma$ and network instability at high $\gamma$.

This paper addresses this gap by asking whether we can modify the reward function such that an agent planning for a short, stable horizon still converges to the optimal policy for the long-term goal.

Methodology: Adaptive Reward Tweaking (RT)

The authors propose Adaptive Reward Tweaking (RT), a framework where the agent does not interact with the raw environment reward ($r$) directly. Instead, it receives a "tweaked" surrogate reward ($\tilde{r}$) generated by a dedicated module.

The Reward Tweaking framework. A Reward Tweaker module learns a surrogate reward $\tilde{r}$ to align the agent's short-horizon objectives with the true long-horizon goal.

Learning the Surrogate Reward

The objective is to find an $\tilde{r}$ such that an agent maximizing the $\gamma$-discounted sum of $\tilde{r}$ effectively maximizes the undiscounted total sum of the original environment rewards $r$. The process involves several key components:

  • Trajectory Ranking: The system collects trajectories and ranks them based on their true, undiscounted total rewards.
  • Max-Margin Learning: The reward tweaker, implemented as a neural network, is trained via supervised classification. It learns to assign values to states such that "better" trajectories (those with higher true rewards) yield a higher discounted sum of surrogate rewards than "worse" trajectories.
  • Online Integration: Unlike traditional Inverse RL, which requires static expert demonstrations, Reward Tweaking occurs online. The agent explores the environment, the tweaker learns from the resulting experience, and the agent subsequently updates its policy based on the evolving surrogate rewards.

Theoretical Insights and Robustness

The paper provides a theoretical foundation for this approach, proving that for any discount factor $\gamma > 0$, there exists a surrogate reward function capable of inducing the optimal long-horizon policy. A critical insight is that to overcome myopia, the surrogate reward often needs to be non-stationary (time-dependent). For instance, a reward might be artificially inflated early in an episode to keep a short-sighted agent on a path that only pays off much later.

Furthermore, the authors demonstrate that an optimal surrogate reward enhances the agent's robustness. It can mitigate the impact of errors in the agent's internal model of environment transitions, providing a more reliable signal for policy improvement.

Experimental Evaluation

The researchers evaluated Reward Tweaking across diverse domains:

  • Tabular MDPs: In environments like the Chain MDP and Puddle World, RT successfully guided agents past "distractor" rewards that typically trap myopic agents. In Puddle World, even an agent with $\gamma=0$ (looking only one step ahead) reached the goal because the surrogate reward created a dense gradient toward the objective.
  • Continuous Control: In the Hopper-v2 environment, RT consistently outperformed the standard TD3 baseline. Notably, at the common setting of $\gamma = 0.99$, Reward Tweaking achieved a 6% performance improvement, demonstrating its utility even within the typically "stable" region of standard RL.

Conclusion and Future Work

Reward Tweaking offers a promising path toward solving long-horizon tasks without the instability of high discount factors. By transforming sparse, distant goals into dense, immediate surrogate signals, it bridges the gap between stability and optimality.

However, the method introduces computational overhead due to the additional reward-learning network and the need to process entire trajectory segments. Future research could focus on optimizing this overhead and investigating whether reward tweaking can be specifically tuned to stabilize the extreme high-$\gamma$ regimes where neural network training currently fails.

Summary updated

BibTeX
@misc{tessler2020maximizing,
  author = {Chen Tessler and Shie Mannor},
  title = {{Maximizing the Total Reward via Reward Tweaking}},
  year = {2020},
  eprint = {2002.03327},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.03327},
}
Figure