Inference Time Policy Optimization for Offline RL with Differentiable World Models
Organizations: Siebel School of Computing and Data Science, Department of Computer Sciences, University of Illinois Urbana-Champaign · University of Wisconsin Madison
Abstract
Offline Reinforcement Learning (RL) learns optimal policies from fixed datasets, training a policy once and deploying it at inference time without further refinement. Inspired by model predictive control (MPC), we introduce an inference time adaptation framework that utilizes a pretrained policy along with a learned world model. While existing world model and diffusion-planning methods use learned dynamics to generate imagined trajectories during training, or to sample candidate plans at inference time, they do not use inference-time information to optimize the policy parameters on the fly. In contrast, our design is a Differentiable World Model (DWM) pipeline that enables end-to-end gradient computation through imagined rollouts for inference time policy optimization (ITPO). We evaluate our algorithm on D4RL continuous-control benchmarks (MuJoCo locomotion tasks and AntMaze), and show that exploiting inference-time information to optimize the policy parameters yields consistent gains over strong offline RL baselines. Inference-time adaptation, however, is expensive: rollout generation and backpropagation dominate per-step compute. We study this tradeoff explicitly, showing that a suitable tilted version of one-step MeanFlow sampler recovers much of the gains at a fraction of the cost.
Figures & tables
| Dataset | TD3+BC | IQL | CQL | ReBRAC | \color[rgb]{0,1,0}\mathtt{DiffMPC} |
|---|---|---|---|---|---|
| halfcheetah | |||||
| medium | |||||
| expert | |||||
| medium-expert | |||||
| medium-replay | |||||
| full-replay | |||||
| Task Name | ReBRAC | \color[rgb]{0,1,0}\mathtt{DiffMPC} |
|---|---|---|
| antmaze-umaze | ||
| umaze-diverse | ||
| medium-play | ||
| medium-diverse | ||
| large-play | ||
| large-diverse |
| Dataset | DT | TT | MOPO | MOReL | MBOP | Diffuser | \color[rgb]{0,1,0}\mathtt{DiffMPC} |
| HalfCheetah | |||||||
| medium-expert | 86.8 | 95.0 | 63.3 | 53.3 | 105.9 | ||
| medium | 42.6 | 46.9 | 42.3 | 42.1 | 44.6 | ||
| medium-replay | 36.6 | 41.9 | 53.1 | 40.2 | 42.3 | ||
| Hopper | |||||||
| medium-expert | 107.6 | 110.0 | 23.7 | 108.7 | 55.1 | ||
| Task Name | D-MPC | \color[rgb]{0,1,0}\mathtt{DiffMPC} |
|---|---|---|
| halfcheetah medium | ||
| hopper medium | ||
| walker2d medium | ||
| halfcheetah medium-replay | ||
| hopper medium-replay | ||
| walker2d medium-replay |
Appendix figures & tables29 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | Diffusion one-step RMSE ( SE) | Reward RMSE ( SE) |
|---|---|---|
| halfcheetah-random | 0.2318 0.000010 | 0.0477 0.0016 |
| halfcheetah-medium | 0.5494 0.000014 | 0.1292 0.0034 |
| halfcheetah-expert | 1.3065 0.000026 | 0.2763 0.0076 |
| halfcheetah-medium-expert | 0.5972 0.000013 | 0.1622 0.0045 |
| halfcheetah-medium-replay | 0.3996 0.000014 | 0.0918 0.0027 |
| halfcheetah-full-replay | 0.4739 0.000014 | 0.1164 0.0033 |
| Dataset | ||||
| halfcheetah | ||||
| medium | 5 | 1 | 8,192 | |
| expert | 2 | 1 | 4,096 | |
| medium-expert | 5 | 1 | 8,192 | |
| medium-replay | 5 | 1 | 8,192 | |
| full-replay | 5 | 1 | 4,096 | |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium | |||||
| medium-replay | |||||
| medium-expert | |||||
| expert | |||||
| full-replay |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium-replay | |||||
| medium-expert | |||||
| full-replay | |||||
| expert |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium | |||||
| medium-replay | |||||
| medium-expert | |||||
| full-replay | |||||
| expert |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium | |||||
| medium-replay | |||||
| medium-expert | |||||
| expert | |||||
| full-replay |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium-replay | |||||
| medium-expert | |||||
| full-replay | |||||
| expert |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium | |||||
| medium-replay | |||||
| medium-expert | |||||
| full-replay | |||||
| expert |
| Dataset | |||
|---|---|---|---|
| random | |||
| medium | |||
| medium-replay | |||
| medium-expert | |||
| expert | |||
| full-replay |
| Dataset | |||
|---|---|---|---|
| random | |||
| medium-replay | |||
| medium-expert | |||
| full-replay | |||
| expert |
| Dataset | |||
|---|---|---|---|
| random | |||
| medium | |||
| medium-replay | |||
| medium-expert | |||
| full-replay | |||
| expert |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium | |||||
| medium-replay | |||||
| medium-expert | |||||
| expert | |||||
| full-replay |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium-replay | |||||
| medium-expert | |||||
| full-replay | |||||
| expert |
| Dataset | |||||
|---|---|---|---|---|---|
| random | |||||
| medium | |||||
| medium-replay | |||||
| medium-expert | |||||
| full-replay | |||||
| expert |
| Dataset | |||
|---|---|---|---|
| random | |||
| medium | |||
| medium-replay | |||
| medium-expert | |||
| expert | |||
| full-replay |
| Dataset | |||
|---|---|---|---|
| random | |||
| medium-replay | |||
| medium-expert | |||
| full-replay | |||
| expert |
| Dataset | |||
|---|---|---|---|
| random | |||
| medium | |||
| medium-replay | |||
| medium-expert | |||
| full-replay | |||
| expert |
| Dataset | SAC-RND (zero-shot) | \color[rgb]{0,1,0}\mathtt{DiffMPC} |
|---|---|---|
| halfcheetah | ||
| medium | ||
| medium-replay | ||
| medium-expert | ||
| full-replay | ||
| expert | ||
| Dreamer family | TD-MPC family | Ours | |
|---|---|---|---|
| When is the model used? | Training | Inference | Inference |
| What is optimized? | Actor parameters | Action sequences | Policy parameters |
| How is it optimized? | Gradient (BPTT) | Gradient-free (MPPI) | Gradient (BPTT) |
| Setting | Online | Online | Offline |
| Dynamics | Latent (RSSM) | Latent (TOLD) | Explicit (generative) |
| Deployment cost | Single forward pass | MPPI search | Inner-loop gradient updates |
| TD-MPC2 | TD-MPC2 (offline with BC loss) | |||
|---|---|---|---|---|
| Dataset | Final | Best | Final | Best |
| halfcheetah-random | ||||
| halfcheetah-medium | ||||
| halfcheetah-medium-replay | ||||
| halfcheetah-medium-expert | ||||
| halfcheetah-expert | ||||
| Jyothir et al. | Romero et al. | Ours | |
|---|---|---|---|
| What is optimized? | Action sequences | Cost-map parameters | Policy parameters |
| How is it optimized? | Gradient (BPTT) | Gradient through MPC solver | Gradient (BPTT) |
| When? | Inference | Training and inference | Inference |
| Dynamics | Learned latent | Analytic | Learned generative |
| Setting | Online | Online | Offline |
| Domain | Visual control | Quadrotor flight | D4RL benchmarks |
| Dataset | Grad-MPC | \color[rgb]{0,1,0}\mathtt{DiffMPC} |
|---|---|---|
| halfcheetah | ||
| medium | ||
| expert | ||
| medium-expert | ||
| medium-replay | ||
| full-replay | ||
| Zhou et al. | Ours | |
|---|---|---|
| What is optimized? | Action sequence (best candidate) | Policy parameters |
| How is it optimized? | Gradient-free (random shooting) | Gradient (BPTT) |
| Dynamics | Multi-step trajectory diffusion | One-step transition diffusion |
| Action source | Learned diffusion proposal | Pretrained behavior policy |
| Task Name | D-MPC | \color[rgb]{0,1,0}\mathtt{DiffMPC} |
|---|---|---|
| halfcheetah medium | ||
| hopper medium | ||
| walker2d medium | ||
| halfcheetah medium-replay | ||
| hopper medium-replay | ||
| walker2d medium-replay |
| Task Name | Zero Shot | \color[rgb]{0,1,0}\mathtt{FlowMPC} |
|---|---|---|
| halfcheetah-medium | ||
| halfcheetah-expert | ||
| halfcheetah-medium-expert | ||
| halfcheetah-medium-replay | ||
| halfcheetah-full-replay | ||
| hopper-medium |
| Diffusion Steps | Diffusion (ms) | MeanFlow (ms) | Speedup |
| HalfCheetah | |||
| 10 | x | ||
| 20 | x | ||
| 30 | x | ||
| 40 | x | ||
| 50 | x | ||
| Diffusion Steps | Diffusion Total (ms) | MeanFlow Total (ms) | Speedup |
| HalfCheetah | |||
| 10 | x | ||
| 20 | x | ||
| 30 | x | ||
| 40 | x | ||
| 50 | x | ||
Inference-Time Optimization
Inference-time optimization adapts model computation, outputs, or runtime settings to improve quality under deployment constraints.
See all 96 papers