Offline Reinforcement Learning via Inverse Optimization

Ioannis Dimanidis, Tolga Ok, Peyman Mohajerin Esfahani

TL;DR

This paper introduces an offline reinforcement learning framework that replaces brittle, non-convex Bellman error minimization with Inverse Optimization (IO) and convex optimization. By pairing an in-hindsight robust Model Predictive Control (MPC) "teacher" with an IO "student" trained via a convex sub-optimality loss, the method achieves competitive performance on continuous control benchmarks using orders of magnitude fewer parameters and training time than deep offline RL baselines.

What Problem Does This Paper Address?

Offline Reinforcement Learning (RL) aims to learn high-performing control policies from fixed, pre-collected datasets without active environment exploration. A core obstacle is distributional shift: when a learned policy selects actions different from those in the dataset, function approximators (like deep neural networks) evaluate unseen state-action pairs with overly optimistic, biased value estimates, leading to catastrophic failure at deployment.

Existing solutions typically apply heavy pessimism or conservative penalties. However, these methods rely on non-convex Bellman residual minimization, are computationally demanding, notoriously unstable to tune, and struggle in low-data regimes. The authors ask: Can we reformulate offline policy improvement and policy distillation into tractable, convex optimization problems using nominal physical priors and trajectory data?

Methods

The proposed algorithm splits offline RL into two tractable steps:

[Offline Dataset + Nominal Model]
               │
               ▼
1. Non-Causal Action Improvement (Robust MPC Expert)
   • Compute hindsight residuals: ŵ_{t+1} = E†(x̂_{t+1} - f₀(x̂_t, û_t))
   • Solve exact SDP min-max MPC over disturbance ball W(w)
               │
               ▼ Improved Actions {û_t^ex}
2. Policy Distillation via Inverse Optimization (Causal Student)
   • Minimize convex "sub-optimality loss": ℓ_sub(s, û^ex) = Q_θ(s, û^ex) - min_u Q_θ(s, u)
   • Yields causal quadratic Q-function policy: π_θ(s) = argmin_u Q_θ(s, u)
  1. Non-Causal Action Improvement (Robust MPC Teacher): Using a nominal model of the dynamics ($f_0$), the algorithm computes the in-hindsight model mismatches ($w_{t+1} = \hat{x}_{t+1} - f_0(\hat{x}_t, \hat{u}_t)$). A non-causal MPC planner uses these future disturbances along the collected trajectory to generate improved actions. To guard against noise and distribution shift, the authors formulate a robust counterpart optimizing against worst-case disturbance trajectories in an ellipsoidal uncertainty set $\mathcal{W}(w)$. Crucially, for linear nominal models with polytopic constraints, they leverage the exact S-Lemma to derive an exact semidefinite programming (SDP) reformulation, avoiding common conservative approximations.

  2. Policy Distillation via Inverse Optimization (Causal Student): Because the MPC teacher requires future disturbances, it cannot run online. The student policy causally predicts actions from past observations using the sub-optimality loss from Inverse Optimization. Fitting a strongly convex quadratic Q-function hypothesis class under polytopic control constraints yields an exact, convex optimization problem that guarantees convergence to the global optimum.

Datasets

The authors evaluate their framework on simulated continuous control tasks:

  • Safe-Control-Gym (Quadrotor): A 6D non-linear quadrotor stabilization task under unmodeled sinusoidal external forces and Gaussian noise.
  • D4RL Benchmark: Standard offline RL datasets on MuJoCo locomotion environments, specifically hopper-medium-v2 and walker2d-medium-v2 (as well as walker2d-expert-v2). The authors evaluate both full-data (1M samples) and low-data regimes (first 5K samples for Hopper, first 10K for Walker2d).
  • Synthetic Control Benchmarks (Appendix): A 6D linearized fighter jet system with state/input constraints and a 4th-order non-linear coupled temperature control system.

No new public benchmarks are introduced.

Key Insights and Ideas

  • Hindsight as a Free Oracle: While disturbances and model mismatches cannot be anticipated online, they are fully observable in offline logs. Feeding hindsight disturbances directly into an MPC planner bypasses the difficult task of learning complex residual disturbance models from scratch.
  • Robustness Mimics Exploration: In offline RL, policy improvement typically requires exploration bonuses or pessimistic penalties. Here, tuning the uncertainty radius $\varrho$ in the robust MPC expert acts as an adversarial buffer against unseen disturbances, effectively performing the role of exploration and regularizing against out-of-distribution transitions.
  • Convexity Beats Deep Overparameterization: By avoiding gradient descent through non-convex Bellman updates, the IO loss function guarantees that the policy parameters are fitted via a convex program, offering high training stability and sample efficiency.
  • Feature Augmentation Over Network Depth: When paired with basic feature engineering (e.g., disturbance histories, cross-products, sinusoids, or kernel features), a simple quadratic Q-function captures rich periodic and nonlinear behaviors without deep architectures.

Key Results

  • Sample Efficiency in Quadrotor Control: The IO-RMPC policy trained on just $T = 3{,}000$ samples matched or surpassed Conservative Q-Learning (CQL) agents that required tens of thousands of samples, and beat on-policy PPO trained with 3 million environment steps.
  • Competitive Scores in Low-Data MuJoCo: In sample-constrained regimes, plain IO matched or outperformed complex deep offline RL baselines:
  • Hopper 5K (Best Epoch): IO scored $83.8 \pm 9.7$, outperforming CQL ($72.3 \pm 1.5$), COMBO ($68.4 \pm 7.1$), MOPO ($26.2 \pm 8.4$), and TD3+BC ($32.6 \pm 0.9$).
  • Walker2d 10K (Best Epoch): IO reached $72.1 \pm 1.4$, outperforming CQL ($67.8 \pm 2.2$), MOPO ($16.9 \pm 4.6$), and TD3+BC ($5.4 \pm 0.9$).
  • Dramatic Efficiency Gains: On Walker2d, the IO policy uses 9,390 parameters and trains in 1.24 seconds per epoch, compared to CQL (414,732 parameters; 418.11s/epoch) and COMBO (1,320,672 parameters; 479.86s/epoch)—a >100× parameter reduction and >100× training speedup.

Limitations and Future Work

  • Reliance on a Nominal Model: The robust MPC action improvement step requires a reasonably good nominal physics model $f_0$. For environments with complex discontinuous contact dynamics (such as full MuJoCo environments), deriving an analytical nominal model is difficult; hence, MuJoCo tests relied purely on plain IO distillation of existing dataset actions.
  • Scalability of the IO SDP: The distillation step introduces an LMI constraint per data point, meaning large datasets ($T \gg 10^5$) require iterative stochastic gradients or kernel coordinate descent rather than off-the-shelf interior-point SDP solvers.
  • Future Directions: Adapting the robust min-max MPC formulation directly to off-policy RL settings without known nominal models, and leveraging Online Convex Optimization tools to update distilled non-causal policies in real time.

Summary updated

BibTeX
@article{dimanidis2025offline,
  author = {Ioannis Dimanidis and Tolga Ok and Peyman Mohajerin Esfahani},
  title = {{Offline Reinforcement Learning via Inverse Optimization}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=lSj2gXoeCy},
}
Figure