Abstract
Recent works have shown the potential of diffusion models in computer vision and natural language processing. Apart from the classical supervised learning fields, diffusion models have also shown strong competitiveness in reinforcement learning (RL) by formulating decision-making as sequential generation. However, incorporating temporal information of sequential data and utilizing it to guide diffusion models to perform better generation is still an open challenge. In this paper, we take one step forward to investigate controllable generation with temporal conditions that are refined from temporal information. We observe the importance of temporal conditions in sequential generation in sufficient explorative scenarios and provide a comprehensive discussion and comparison of different temporal conditions. Based on the observations, we propose an effective temporally-conditional diffusion model coined Temporally-Composable Diffuser (TCD), which extracts temporal information from interaction sequences and explicitly guides generation with temporal conditions. Specifically, we separate the sequences into three parts according to time expansion and identify historical, immediate, and prospective conditions accordingly. Each condition preserves non-overlapping temporal information of sequences, enabling more controllable generation when we jointly use them to guide the diffuser. Finally, we conduct extensive experiments and analysis to reveal the favorable applicability of TCD in offline RL tasks, where our method reaches or matches the best performance compared with prior SOTA baselines.
Introduction
In Offline Reinforcement Learning (RL), agents must learn optimal behaviors from a fixed dataset without further environment interaction. Recently, Diffusion Probabilistic Models (DPMs) have shown promise by modeling RL as a sequence generation problem: instead of generating pixels, they generate sequences of states and actions. However, existing diffusion-based RL methods often rely on "heuristic" conditions, like a single target return value, to guide generation. This is often insufficient because RL is inherently temporal. Current models frequently ignore historical context (how the agent reached the current state) and immediate dependencies (the direct reward of the next action), leading to sub-optimal trajectories that may fail to follow the environment's actual dynamics.
Methods: The Temporally-Composable Diffuser (TCD)
The core innovation of TCD is breaking down the guidance into three non-overlapping temporal "buckets" to ensure more controllable and physically grounded generation:
- Historical Condition ($C_{HC}$): Uses preceding states to provide context. This is crucial for partially observable environments where the current state alone is insufficient for decision-making.
- Immediate Condition ($C_{IC}$): Focuses on the reward of the current action. This acts as a "local compass," ensuring the generated next step is beneficial.
- Prospective Condition ($C_{PC}$): Uses Return-to-Go (RTG) and remaining time steps to guide the agent toward a high-reward future.
TCD uses classifier-free guidance to combine these conditions during the diffusion denoising process. This allows the model to "compose" different instructions—such as following a specific history while aiming for a high immediate reward and a final goal—without requiring retraining for every combination.
Experimental Results
TCD was evaluated on the standard D4RL benchmark, including Gym-MuJoCo locomotion, Maze2D navigation, and Adroit robotic manipulation tasks. The model consistently outperformed or matched prior state-of-the-art (SOTA) baselines like Decision Diffuser (DD), IQL, and CQL.
In Gym-MuJoCo tasks, TCD achieved an average normalized score of 85.67, surpassing Decision Diffuser's 81.8. It showed particularly strong gains in "Medium-Replay" datasets, where data is diverse and noisy. Qualitative results in Maze2D showed that TCD can successfully generate different trajectories from the same starting point simply by varying the historical or immediate reward conditions, demonstrating superior controllability over baseline models.
Conclusion
TCD demonstrates that explicit temporal conditioning is a powerful tool for diffusion-based RL. By decomposing trajectory information into historical, immediate, and prospective components, TCD achieves more stable and controllable generation than models relying on global heuristics. Future work will focus on improving inference speed and extending this framework to online RL settings.
Summary updated