# To the Max: Reinventing Reward in Reinforcement Learning

Max-reward RL optimizes the best reward instead of the cumulative sum

Grigorii Veviurko, Wendelin Böhmer, Mathijs de Weerdt · arXiv · 2024-2-2

- **Problem** Hand-tuned dense rewards are fragile, and a poor one can change the optimal policy. Standard RL then gets stuck on suboptimal behavior when goals are rare.
- **Method** Max-reward RL optimizes the largest discounted reward seen in an episode instead of the cumulative sum. It tracks that maximum as an extra variable in the state, so the usual algorithms can be used.
- **Results** Max-reward TD3 and PPO worked for every sparsity k from 1 to 4 in the DSP reward tests. Standard RL did not work at larger k, where cumulative methods converged to suboptimal policies.

## Why reward design is hard for goal-reaching agents

Reward design is hard because the true reward is often sparse, so the agent only receives a signal when it completes the task. Goal-reaching problems are the typical case, and sparse reward is characteristic of them because the agent must enter the goal state. Standard RL struggles with these sparse problems, which is why practitioners often reach for a shortcut.

The usual shortcut is a dense surrogate reward that represents some sort of distance between the agent and the goal. That surrogate is very sensitive, because it must be tailored to each problem so that it doesn't change the induced optimal policy. Checking both conditions means estimating the discounted cumulative returns in various states, which is tricky even for a human expert.

Standard RL maximizes the cumulative return, and it learns the value of a non-terminal state by bootstrapping. Because each bootstrapped target depends on the next value estimate, the target keeps moving during training. This means that max-reward RL bootstraps less, and hence, potentially, learns better. The obstacle is that the natural max-based Bellman update, as Cui & Yu (2023) show, works only in a deterministic setting.

Earlier max-reward work by Gottipati et al. (2020) and related safe RL methods share this limit to deterministic environments and policies. So a max-reward method that also handles randomness needs a different Bellman-like rule. The authors draw on stochastic optimal control theory (Kröner et al., 2018) to build such a framework for the general stochastic setting.

## Where the naive max-reward Bellman update fails

Gottipati et al. (2020) define the max-reward state-action value with a binary max placed inside the expectation. Their Bellman-like operator is a contraction, so Q-learning can learn this value. The catch is that the max and the expectation don't commute once the process is stochastic. Expanding the definition for more timesteps gives a nested sequence of non-interchangeable max and expectation operators.

Using Jensen's inequality, the deterministic value becomes only a lower bound on the expected max-reward return. Under stochasticity, the operator can therefore induce suboptimal policies. In the three-state MDP, policy π1 has the higher expected max-reward return from s0, 9 against 8. Yet the deterministic operator gives π1 a value of 6 and π2 a value of 8, so it would wrongly prefer π2.

The three-state MDP has deterministic transitions and stochastic rewards, and both policies share the same first action a1. The authors left open whether a Bellman-like operator could learn max-reward returns under stochasticity. Their earlier deterministic methods, including Gottipati et al. (2020), apply only to deterministic environments and policies.

The authors then turn to an auxiliary variable y, defined in Definition 4.1, to handle this gap.

## Carrying the best reward so far in an extended state

The key idea is to add one real-valued auxiliary variable y to the state, so that y carries the best discounted reward seen so far. The value of a state with y is the expectation of the larger of y and the max-reward return: \\\[ \\hat v^\\pi(s,y)=\\mathbb{E}\_\\pi\[y\\vee\\hat G\_t\\mid s\_t=s\] \\\] The max-reward return is the largest of the discounted rewards from the current step onward, \\(\\hat G\_t=\\max\\{r\_{t+1},\\gamma r\_{t+2},\\gamma^2 r\_{t+3},\\dots\\}\\).

Because rewards are non-negative, setting y to 0 recovers the expected max-reward return.

The paper's example makes this concrete: if the largest reward so far is r1, the extended state at time t is \\((s\_t, r\_1\\gamma^t)\\). Given an extended state, the transition puts all probability on one next value of y, fixed by the reward and the current y. The authors state that the optimal policy must therefore depend on the rewards collected so far, not only on the current state.

The authors show that the value functions satisfy Bellman-like equations, \\\[ \\hat v^\\pi(s,y)=\\gamma\\,\\mathbb{E}\\left\[y'\\vee\\hat v^\\pi(s\_{t+1},y')\\mid s\_t=s\\right\] \\\] where y' is the next auxiliary value. The extra y' ∨ term enforces boundary conditions, since without it the all-zero functions would also solve these equations. The operator built from these equations is a γ-contraction in the L∞ norm, and the max-reward value function is its fixed point.

So max-reward values can be learned the same way as ordinary values, by sampling transitions and applying the operator. The version with a maximum over next actions is also a γ-contraction.

## The max-reward objective and its policy gradients

The max-reward objective averages the max-reward value of the initial state, with y set to 0, over the start distribution. On the three-state example from Figure 2, the objective gives 9 for π1 and 8 for π2, so π1 is optimal. Yet from s1, π2 gives a higher expected max-reward return, which looks contradictory at first. So the best action depends on the maximum reward acquired so far, not only on the current state.

Starting from s0, the agent receives r1 = 6 on the way to s1, so later r2 = 0 can't push the maximum below 6.

The extended state space adds the auxiliary variable y to the state, giving pairs (s, y) with y in R. The extended transition model sets the next y to the maximum of the immediate reward and y times the discount, divided by γ. The initial distribution puts y0 at 0, so the process starts with no reward seen. Any policy on the extended states is called an extended max-reward policy.

DQN-based methods can therefore be applied directly, but most state-of-the-art algorithms use neural network policies.

The authors define the discounted stationary distribution over extended states and normalize it with the constant C. Corollary 4.10 derives the deterministic version, which uses the action gradient of the max-reward Q function. These gradients let algorithms such as REINFORCE, A2C, A3C, TRPO, PPO, DDPG and TD3 optimize maximum rewards.

The authors focus on PPO and TD3, which they consider the best-performing methods in their families. For max-reward PPO, only the advantage estimation changes, and it uses max-reward returns. For max-reward TD3, the critic target uses the max-reward Bellman optimality operator. The experiments compare these max-reward versions with their cumulative counterparts on two goal-reaching environments from Gymnasium-Robotics.

## Chain experiment: rare goal transitions

The five-state chain has three actions in each state, and transitions into s4 give a reward of 1. Transitions into s2 carry an intermediate reward x in (0, 1), and every other reward is zero. The optimal policy is the same under both return types: go to s4 and stay there. The authors run tabular Q-value iteration once with the standard Bellman operator and once with the max-reward operator.

In each epoch they sweep over all transitions and update the Q-table for each one.

To make goal transitions rare, the authors skip transitions into s4 with a fixed probability. They test skip probabilities of 0, 0.3, 0.6 and 0.9. Transitions into other states are never skipped, so the skip rate controls how often the agent sees the optimal state.

For larger skip probabilities, max-reward value iteration reaches the optimal policy clearly faster than the cumulative version. The authors attribute this to bootstrapping. In the cumulative case, the target is the immediate reward plus the next Q value, so it shifts every epoch until convergence. In the max-reward case, the target at the goal state is just the reward, and it doesn't change over time.

The authors read this chain result as evidence that max-reward suits environments where reaching the goal is rare.

## Maze results with surrogate rewards

The Maze is a Gymnasium-Robotics task in which a ball is controlled by two-dimensional acceleration toward a goal. The single-goal maze keeps the goal fixed, while the two-goals maze picks one of two goal locations per episode. The main metric is the success ratio, a binary value that records whether the goal was reached in the episode.

The authors compare three reward families that share the same optimal policy: sparse, dense l2, and the discrete shortest path (DSP) reward. The DSP reward gives \\(\\beta^{D\[i,j\]+1}\\) to cells whose distance is zero mod k and zero elsewhere, so larger k makes the reward sparser. They first tuned β on the single-goal maze with k equal to 1, running 10 random seeds per algorithm for β from 0.65 to 0.95.

The best negative DSP reward used β equal to 0.9 for TD3 and 0.95 for PPO, and these values were reused in the other runs.

Figure 4 compares TD3, PPO and their max-reward versions across six reward functions on both mazes. Sparse rewards behave inconsistently, which the authors blame on insufficient exploration, and the dense l2 reward has local maxima. Max-reward TD3 and PPO worked for every k from 1 to 4, while standard RL did not work at larger k, where cumulative methods converged to suboptimal policies.

![Figure 4: Learning curves of TD3, max-reward TD3, PPO, and max-reward PPO on two different mazes. The vertical axis is the success ratio, i.e., whether the goa…](https://refivu.com/papers/03998282-c5e6-4ef1-816e-db0cf7914a6b/figures/figure-6db43de7462c84158f4eeeab6c0e2dfd.png?thumb=512)

**Figure 4** . Learning curves of TD3, max-reward TD3, PPO, and max-reward PPO on two different mazes. The vertical axis is the success ratio, i.e., whether the goal was reached during the episode. The shaded area is the standard error of the mean. The horizontal axis is the total environmental timesteps in millions. For each maze, we present results for six different reward functions (columns).

[Original paper](https://arxiv.org/abs/2402.01361v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Grigorii Veviurko, Wendelin Böhmer, Mathijs de Weerdt · To the Max: Reinventing Reward in Reinforcement Learning · Original paper figure · Extracted the figure area from page 7 of the original PDF.

The authors connect this to the chain result, since the Maze behaves like a longer chain with several intermediate rewards. With larger k the cells with non-zero reward lie farther apart, so the transitions to a better cell become rarer. The authors also argue that a max-reward policy conditioned on the best discounted reward so far has no incentive to stay in a local optimum.

Combined with entropy regularization in PPO, they expect agents to leave local optima after visiting them.

## Stochastic maze with randomly replaced actions

The authors add a slip parameter p\_slip to the single-goal maze, so each action is replaced by a random action with probability p\_slip. They test p\_slip values of 0.1, 0.2 and 0.3 on the single-goal maze with DSP reward at k equal to 3. They chose k equal to 3 because max-reward methods already improved over standard RL on the deterministic maze at that value.

The deterministic maze is the same task without the action replacement, so the change in stochasticity is the only difference the slip parameter introduces.

![Figure 5: Learning curves of TD3, max-reward TD3, deterministic max-reward TD3, PPO, and max-reward PPO on a stochastic version of the single-goal maze with DS…](https://refivu.com/papers/03998282-c5e6-4ef1-816e-db0cf7914a6b/figures/figure-cccf7a7401e592821038693674402be0.png?thumb=512)

**Figure 5** . Learning curves of TD3, max-reward TD3, deterministic max-reward TD3, PPO, and max-reward PPO on a stochastic version of the single-goal maze with DSP reward, k = 3. The vertical axis is the success ratio, the shaded area is the standard error of the mean. The horizontal axis is the total environmental timesteps. The results confirm that our max-reward methods work in stochastic environments.

[Original paper](https://arxiv.org/abs/2402.01361v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

The comparison includes standard TD3 and PPO, max-reward TD3 and PPO, and the deterministic max-reward TD3 of Gottipati et al. (2020). Deterministic max-reward TD3 is the baseline that tests whether the Bellman operator of Gottipati et al. (2020) survives stochastic transitions. Earlier, the paper argued that this operator gives only a lower bound on the expected max-reward return when stochasticity is present.

Figure 5 shows the learning curves for these settings, with the vertical axis as the success ratio and the shaded area as the standard error of the mean.

The authors read Figure 5 as confirming that max-reward methods work in stochastic environments. Max-reward TD3 solves this stochastic environment, while the deterministic max-reward TD3 is highly inconsistent. The authors conclude that their method can be used for stochastic environments. The body describes only the TD3 outcome in words, so the PPO results rest on the figure alone.

## Fetch manipulation results

The Fetch tasks use a 7-DoF manipulator that must move a puck to a target location. In Fetch-Slide the goal lies beyond the reach, so the puck must be slid, while in Fetch-Push the puck must be pushed to a goal anywhere on the platform. Episodes are truncated after 100 timesteps, the reward is the negative l2 distance between puck and goal, and the metric is the success ratio.

Figure 6 plots the success ratio for standard and max-reward TD3 on both tasks. Max-reward TD3 reaches a goal-reaching policy on both tasks, while standard TD3 fails to learn completely. The authors attribute this to the bootstrapping difference and to rare goal transitions in a multidimensional task. Only TD3 is compared here, so this experiment doesn't test max-reward PPO on Fetch.

![Figure 6: Success ratio for standard (light red) and max-reward (dark-red) TD3 in Fetch Slide (left) and Fetch Push (right) environments](https://refivu.com/papers/03998282-c5e6-4ef1-816e-db0cf7914a6b/figures/figure-57df9d79127ea8624de01018fd266351.png?thumb=512)

**Figure 6** . Success ratio for standard (light red) and max-reward (dark-red) TD3 in Fetch Slide (left) and Fetch Push (right) environments.

[Original paper](https://arxiv.org/abs/2402.01361v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

## Where the evidence stops

The experiments cover only two Gymnasium-Robotics goal-reaching environments, the Maze and Fetch. The Maze comparison runs TD3 and PPO with their max-reward versions, while the Fetch comparison uses TD3 alone. The chain test is tabular and has five states, so it doesn't show how the method behaves with function approximation. The main metric is the success ratio, which records only whether the goal was reached during an episode.

The paper doesn't report how fast the puck reaches the target or how close the agent gets when it fails.

The earlier deterministic max-reward methods only apply to deterministic environments and policies, and that gap is what this paper targets. The authors use the stochastic Maze with a p\_slip parameter to test their method outside the deterministic setting. They don't test a range of stochastic environments beyond that single maze variant.

The explanations for bootstrapping and local optima are the authors' interpretation, and the paper gives them without a separate test. The authors believe the Fetch gap comes from bootstrapping, but they don't isolate that effect in an experiment.

## Paper info

- **Authors**: Grigorii Veviurko, Wendelin Böhmer, Mathijs de Weerdt
- **Venue**: arXiv · Preprint
- **First published**: 2024-2-2
- **Added**: 2026-10-29
- **Updated**: 2024-7-29
- **Version**: v2
- **arXiv**: 2402.01361
- **Category**: cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2402.01361v2) · [PDF ↗](https://arxiv.org/pdf/2402.01361v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

In reinforcement learning (RL), different reward functions can define the same optimal policy but result in drastically different learning performance. For some, the agent gets stuck with a suboptimal behavior, and for others, it solves the task efficiently. Choosing a good reward function is hence an extremely important yet challenging problem. In this paper, we explore an alternative approach for using rewards for learning. We introduce \\textit{max-reward RL}, where an agent optimizes the maximum rather than the cumulative reward. Unlike earlier works, our approach works for deterministic and stochastic environments and can be easily combined with state-of-the-art RL algorithms. In the experiments, we study the performance of max-reward RL algorithms in two goal-reaching environments from Gymnasium-Robotics and demonstrate its benefits over standard RL. The code is available at https://github.com/veviurko/To-the-Max.

## Quote from the paper

Grigorii Veviurko, Wendelin Böhmer, Mathijs de Weerdt (2024). To the Max: Reinventing Reward in Reinforcement Learning. arXiv:2402.01361v2. https://arxiv.org/abs/2402.01361v2

**BibTeX**

```
@misc{veviurko2024reinventing,
  title = {{To the Max: Reinventing Reward in Reinforcement Learning}},
  author = {Grigorii Veviurko and Wendelin Böhmer and Mathijs de Weerdt},
  year = {2024},
  eprint = {2402.01361},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.01361v2}
}
```

## Related papers

- [On Adaptive Step Sizes for Eligibility Traces in Deep Reinforcement Learning](https://refivu.com/en/papers/f8ab0d56-c0f6-43ce-a3d3-d08d017b18f7-on-adaptive-step-sizes-for-eligibility-traces-in.md)
- [Fade to... Red? Scheduling Coloured Noise Exploration Supports Efficient Robot Learning with Reduced Movement Jerk](https://refivu.com/en/papers/51c54d37-00d0-4705-a3f6-54a87375f97e-fade-to-red-scheduling-coloured-noise-exploration-supports.md)
- [Identifying optimal cycles in quantum thermal machines with reinforcement-learning](https://refivu.com/en/papers/91ae4a4b-783d-4d4a-9036-c66652125ae6-identifying-optimal-cycles-in-quantum-thermal-machines-with.md)
- ["It's Just a Small Weapon": What Rewarding Misbehavior During RL Does to Character-Trained Models](https://refivu.com/en/papers/ff82eb4f-09a9-4988-85f7-9aec117b7142-it-s-just-a-small-weapon-what-rewarding.md)
- [Agentic On-Policy Distillation Implicitly Reshapes LLMs' ReAct Patterns](https://refivu.com/en/papers/55212eb2-2bf0-44da-9bd0-02b1a8938860-agentic-on-policy-distillation-implicitly-reshapes-llms.md)
- [Are Dense Rewards Worth Their Tokens in GRPO?](https://refivu.com/en/papers/abf8fc47-48da-4cd4-a432-583d9b836d54-are-dense-rewards-worth-their-tokens-in-grpo.md)

## Other paper commentary

- [Scaling Properties of Same-Family On-Policy Distillation](https://refivu.com/en/papers/7b699d2e-a190-46ef-9b5a-a697444431cd-scaling-properties-of-same-family-on-policy-distillation.md)
- [Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor](https://refivu.com/en/papers/ea8ec555-d426-4464-bcf3-677288c80a9c-soft-actor-critic-off-policy-maximum-entropy-deep.md)
- [Asynchronous Methods for Deep Reinforcement Learning](https://refivu.com/en/papers/39f3326a-859f-4ab8-9bdb-14644a9778e1-asynchronous-methods-for-deep-reinforcement-learning.md)
- [Continuous control with deep reinforcement learning](https://refivu.com/en/papers/4a1a35c3-732d-4750-869f-588d477a2492-continuous-control-with-deep-reinforcement-learning.md)
- [Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm](https://refivu.com/en/papers/e20db67a-67a1-429f-b55d-64b0f2c15e9e-mastering-chess-and-shogi-by-self-play-with.md)
- [Deep reinforcement learning from human preferences](https://refivu.com/en/papers/46d079bb-6a3c-401d-94a4-5ceb66ab32a1-deep-reinforcement-learning-from-human-preferences.md)
- [Reward-Augmented Data Enhances Direct Preference Alignment of LLMs](https://refivu.com/en/papers/65834077-ca50-4e4f-a8f0-062cd12e44d8-reward-augmented-data-enhances-direct-preference-alignment.md)
- [MUDDFormer: Breaking Residual Bottlenecks in Transformers via Multiway Dynamic Dense Connections](https://refivu.com/en/papers/2b11d064-bbbd-40ba-8755-91e0f98fcbf6-muddformer-breaking-residual-bottlenecks-in-transformers-via.md)
- [SWE-Lancer: Can Frontier LLMs Earn $1 Million from Real-World Freelance Software Engineering?](https://refivu.com/en/papers/a2f97f02-0e25-4600-9ab4-dbca1070183e-swe-lancer-can-frontier-llms-earn-1-million.md)
- [Graph Generative Pre-trained Transformer](https://refivu.com/en/papers/f6ca3fa0-e807-499d-af61-83b0cd89bf26-graph-generative-pre-trained-transformer.md)
- [Identifying and Understanding Cross-Class Features in Adversarial Training](https://refivu.com/en/papers/a920aac5-0b22-4cc2-a5ad-784568bde4da-identifying-and-understanding-cross-class-features-in.md)
- [Training Deep Learning Models with Norm-Constrained LMOs](https://refivu.com/en/papers/fd3f2faf-79d3-4ee1-a9ba-77cd79cb64f7-training-deep-learning-models-with-norm-constrained-lmos.md)

## Terms in this paper

- [PPO](https://refivu.com/en/terms/21c34991d674-ppo)
- [contraction](https://refivu.com/en/terms/52880bf4a077-contraction)
- [TD3](https://refivu.com/en/terms/09ccc5f5354b-td3)
- [Bellman equation](https://refivu.com/en/terms/a3adccfad389-bellman-equation)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/03998282-c5e6-4ef1-816e-db0cf7914a6b-to-the-max-reinventing-reward-in-reinforcement-learning)
