Recursive Reward Aggregation

Yuting Tang, Yivan Zhang, Johannes Ackermann, Yu-Jie Zhang, Soichiro Nishimori, Masashi Sugiyama · DOI

In Reinforcement Learning (RL), the discounted sum of rewards is the standard objective. Most algorithms assume the goal is to maximize this cumulative total. However, real-world objectives often demand more: safety might require maximizing the minimum reward, discovery might target the maximum peak, and finance often prioritizes risk-adjusted metrics like the Sharpe ratio.

The paper "Recursive Reward Aggregation" introduces an algebraic framework that generalizes the Bellman equation. By treating reward aggregation as a recursive process, agents can optimize for diverse objectives directly, avoiding the complexities of manual reward engineering.

The Challenge of Non-Cumulative Objectives

The "Reward Hypothesis" posits that any goal can be framed as maximizing an expected cumulative sum. In practice, this often leads to "reward engineering"—fine-tuning scalar signals to elicit specific behaviors. For instance, avoiding risky states by applying heavy penalties can lead to "reward hacking" or require expanding the state space to track history, increasing computational costs.

The core issue is that many objectives are non-cumulative; they depend on the reward sequence in ways a simple sum cannot capture.

Different reward aggregations (sum, mean, max, min, etc.) applied to the same reward signals result in different optimal policy preferences.

Methodology: An Algebraic Perspective

The authors shift from traditional MDP views to an algebraic perspective rooted in functional programming, specifically recursion schemes.

  1. Recursive Aggregation: Reward aggregation is defined as a "fold" operation. Just as a sum is calculated by adding numbers sequentially, metrics like maximum, mean, or variance can be computed recursively.
  2. Generalized Bellman Equations: The Bellman equation is shown to be a natural property of any recursive generation and aggregation process. New Bellman operators track "statistics" (e.g., running mean and variance) instead of a single value.
  3. Bidirectional Processes: RL is viewed as a forward process (generating rewards) and a backward process (aggregating them from future to present).
  4. Algorithm Integration: Since the fundamental Bellman structure is preserved, this approach integrates into standard algorithms like Q-learning, PPO, and TD3 by swapping the standard operator for a generalized version.
Definitions, initial values, and update functions for various recursive reward aggregations supported by the framework.

Key Insights and Results

The framework identifies the Bellman equation as a "hylomorphism"—unfolding a structure (states/rewards) and immediately folding it back (aggregating them). This allows for diverse policy preferences without state expansion.

Experimental Performance

  • Portfolio Optimization: On S&P 500 data, the recursive method achieved a Sharpe ratio of 1.12, significantly outperforming the "DiffSharpe" baseline (0.29).
  • Physics Simulations: In MuJoCo and Box2D tasks, the method optimized complex objectives like "sum minus variance," enabling direct trade-offs between performance and stability.
  • Consistency: Generalized Bellman operators converged reliably across tasks, maintaining the contractive properties essential for RL stability.

Limitations and Future Directions

Currently, the framework supports only recursive objectives. Non-recursive statistics, such as the median, require seeing the entire sequence and are not yet directly supported. Additionally, in stochastic environments, a gap exists between "expected aggregated reward" and "aggregated expected reward." The authors suggest Distributional RL as a potential solution. Finally, while the framework simplifies using different aggregations, selecting the appropriate one remains a design choice that could potentially be automated in future work.

Summary updated

BibTeX
@inproceedings{tang2025recursive,
  author = {Yuting Tang and Yivan Zhang and Johannes Ackermann and Yu-Jie Zhang and Soichiro Nishimori and Masashi Sugiyama},
  title = {{Recursive Reward Aggregation}},
  booktitle = {RLC},
  year = {2025},
  url = {https://openreview.net/forum?id=13lUcKpWy8},
}
Figure