Introduction
Traditional Reinforcement Learning (RL) typically relies on immediate feedback at every step. However, real-world scenarios often involve rewards that are both delayed and sparse. For instance, a human trainer might observe a robot's behavior for several seconds before providing a single evaluative score.
Existing research in delayed RL often relies on two restrictive assumptions: the Summation Assumption (the final reward is a simple sum of hidden step-wise rewards) and the Markovian Assumption (each step reward depends only on the current state and action). This paper argues that these assumptions fail to capture the complexity of real-world feedback, which is often non-linear and history-dependent. To address this, the authors introduce the RL from Composite Delayed Reward (RLCoDe) problem and propose the Composite Delayed Reward Transformer (CoDeTr).
The CoDeTr Architecture
CoDeTr is designed to learn how to decompose complex, non-linear delayed rewards into meaningful, non-Markovian step rewards. Its architecture consists of two main stages:
- Causal Transformer (The "What"): A GPT-style transformer processes the sequence of states ($s$) and actions ($a$). Because it uses a transformer backbone, the embedding for each time step $t$ incorporates information from all previous steps. This makes the predicted rewards inherently non-Markovian, allowing the model to understand context that simpler models might miss.
- In-Sequence Attention (The "When"): This is the core innovation for credit assignment. Instead of assuming every step contributes equally, CoDeTr uses a bi-directional attention mechanism to calculate importance weights ($w_t$) for each step.
The final predicted delayed reward is the weighted sum of predicted step rewards. The model is trained by minimizing the Mean Squared Error (MSE) between its predicted total reward and the actual reward received from the environment. Once trained, the agent uses these "redistributed" step rewards to learn its policy using standard algorithms like Soft Actor-Critic (SAC).
Experimental Evaluation
The researchers evaluated CoDeTr on high-dimensional locomotion benchmarks, including MuJoCo (Ant, HalfCheetah, Walker2d) and the DeepMind Control Suite (Fish, Cartpole). To test the model's ability to handle "composite" rewards, they created three challenging reward structures:
- SumSquare: Sum of squared step rewards (emphasizes large rewards).
- SquareSum: The square of the sum (highlights overall sequence performance).
- Max: A softmax-weighted sum that focuses almost entirely on the single highest-reward moment in a sequence.
Key Results and Insights
- Superior Performance: CoDeTr consistently outperformed state-of-the-art baselines (like RBT and RRD) across nearly all tasks, especially in the "Max" and "SumSquare" settings where non-linearity is highest.
- Robustness to Delay: As the delay between rewards increased (up to 500 steps), the performance of baseline methods often degraded significantly. CoDeTr maintained high performance, proving its ability to handle long-horizon credit assignment.
- Interpretability: Case studies revealed that the learned attention weights ($w_t$) peaked at the exact moments the agent performed "critical" actions, such as a successful stride in the Ant environment. This demonstrates that the model effectively identifies which moments in a sequence are truly responsible for the final reward.
Conclusion
By breaking the "summation bottleneck," CoDeTr provides a robust framework for learning from complex, non-linear feedback. While the transformer-based approach adds some computational overhead, its ability to handle non-Markovian dependencies and provide interpretable credit assignment makes it a significant advancement for real-world RL applications, particularly those involving human-in-the-loop training.
Summary updated