Offline (batch) RL learns a policy purely from a fixed, previously collected dataset, with no further interaction with the environment during training. The central difficulty is that the agent cannot try out new ideas, so it must avoid trusting value estimates for actions the data never covered.

Tldr

Offline RL is a type of RL where the agent does NOT interact with the environment during training. Instead it learns from a fixed dataset of logged experience: (state, action, reward, next state) tuples.

Setup

The dataset is a fixed collection of transitions gathered by some behavior policy (a prior agent, a mix of policies, or human demonstrations):

  • : state (observation) at step .
  • : action taken by the behavior policy.
  • : reward received.
  • : resulting next state.

is collected before training and cannot be augmented. The goal is still to find a policy maximizing expected return, but now evaluated on a distribution we can only sample indirectly through .

Distribution Shift and Extrapolation Error

The learned policy induces a state-action distribution that differs from ‘s. When the Bellman target evaluates , the maximizing is often an out-of-distribution (OOD) action the dataset never contains. The function approximator extrapolates arbitrarily there, and typically overestimates, since the max seeks out errors. if the argmax lands on an unsupported , is anchored to a fantasy value. There is no environment feedback to correct it, so the error compounds through bootstrapping.

Why off-policy methods fail offline

Online, off-policy methods like DQN correct overestimation because the agent eventually tries the overvalued action, sees a low reward, and pushes the value back down. Offline, that corrective loop is severed: overestimated OOD actions are never sampled, so errors accumulate without bound and the policy chases them. More data does not fix this; it is a query problem, not a sample-size problem.

Formally the issue is a query distribution mismatch: the Bellman backup queries at , but is only reliable on the support of .

Policy Constraint Methods (BCQ, BEAR)

Keep the learned policy close to the behavior policy so that value queries stay in-distribution.

  • BCQ (Batch-Constrained Q-learning): trains a generative model (VAE) of and only considers actions near the behavior actions, then perturbs them slightly. The max is taken over a constrained action set rather than all actions.
  • BEAR: relaxes the hard constraint to a distributional one, keeping within a support set of using a Maximum Mean Discrepancy (MMD) penalty, so unlikely-but-supported actions remain available while OOD ones are excluded.

Tradeoff: constraining to limits improvement when the data is poor, and estimating well can be hard for multimodal or narrow datasets.

Conservative Value Methods (CQL)

Instead of constraining the policy, penalize the values themselves. Conservative Q-Learning (CQL) adds a regularizer that pushes down Q-values on OOD actions and pulls up values on dataset actions, learning a lower bound on the true :

Because the value is conservative, the greedy policy will not be lured toward unsupported actions. CQL avoids explicitly modeling , which makes it robust and popular in practice.

Implicit Methods (IQL)

Implicit Q-Learning (IQL) never queries at OOD actions at all. It fits to an expectile of over dataset actions, approximating the max using only in-sample actions: where the expectile parameter approaches the in-support max. The critic then bootstraps with (no max over actions), and the policy is extracted afterward by advantage-weighted regression: IQL is simple, stable, and strong because it decouples value learning (never leaves the data) from policy extraction.

Sequence-Model Approaches (Decision Transformer)

Decision Transformer reframes offline RL as conditional sequence modeling rather than value learning. It feeds a transformer a sequence of (return-to-go, state, action) tokens and trains it to predict the next action autoregressively: At test time you condition on a desired high return-to-go and let the model generate actions. It sidesteps bootstrapping and the deadly triad entirely (it is supervised learning), which avoids OOD value explosions, but it cannot “stitch” together sub-trajectories as well as value-based methods and relies on the dataset containing high-return behavior.

Model-Based Offline RL

An orthogonal family learns a dynamics model from and plans or trains inside it, which lets the agent generate synthetic rollouts and stitch behavior more aggressively. The catch is the same distribution shift: the model is only accurate near the data.

  • MOPO penalizes rewards by an uncertainty estimate of the model, , so the policy is discouraged from exploiting regions where the model is unreliable.
  • MOReL builds a pessimistic MDP that routes unknown state-actions to a low-reward absorbing state.

The unifying theme across all offline methods is pessimism under uncertainty: constrain the policy, lower-bound the values, or penalize unknown dynamics.

When Offline RL Helps vs Behavior Cloning

Both learn from a fixed dataset, but they answer different questions.

  • Behavior cloning (Imitation Learning) fits : it copies the data. It works only if the data is near-expert and cannot exceed the demonstrator.
  • Offline RL uses rewards and Bellman backups to improve over by stitching good decisions from different trajectories.

When each wins

If the dataset is expert and dense, behavior cloning is simple and hard to beat. If the dataset is a mixture of mediocre trajectories that each contain useful segments, offline RL can stitch them into a policy far better than any single demonstrator, which cloning cannot do. When the dataset is narrow and the reward signal weak, cloning is the safer choice because offline RL’s value estimates have little support to stand on.