Reinforcement Learning, Part ii: Partial Observability, Offline Data, and DTRs

On this page

Reinforcement Learning: i. Foundations and learning methods · ii. Partial observability, offline data, and DTRs.

An agent may lack access to the environment's full state, or it may have to learn without collecting new interactions. These are different restrictions: partial observability concerns information at decision time, while offline learning concerns access to training data. We derive the corresponding belief-state and off-policy value identities, then connect finite-horizon policy learning to dynamic treatment regimes (DTRs).

Recap: What the fully observed Bellman equation assumes

In Part i, a fixed stationary policy satisfies

Vπ(s)=∑aπ(a∣s){r(s,a)+γ∑s′P(s′∣s,a)Vπ(s′)}.V^\pi(s)= \sum_a\pi(a\mid s) \left\{r(s,a)+\gamma\sum_{s'}P(s'\mid s,a)V^\pi(s')\right\}.

Here ss is an observed sufficient state, PP its transition kernel, rr expected immediate reward, and γ<1\gamma<1 the discount factor. Partial observability changes what information can replace ss; offline learning changes how the quantities in this equation can be estimated.

1. Separate the information model from data access

Part i assumed a fully observed Markov decision process (MDP). Its conditional dynamics depended on the current state and action rather than the earlier history. Two separate changes are possible:

Information available to the policyNew interaction allowed during learningFixed logged data only
Fully observed Markov stateOnline RL in an MDPOffline RL in an MDP
Partial observations of a latent Markov stateOnline RL in a POMDPOffline RL in a POMDP

A partially observable Markov decision process (POMDP) assumes Markov dynamics for a hidden, or latent, state. The current observation need not contain enough information to predict the next observation and reward given the action. Offline datasets can arise from fully or partially observed processes. These distinctions follow Kaelbling et al., Section 3 and Levine et al., Sections 2.1–2.2.

2. Partial observability: Redefine the state and history

Let St∈SS_t\in\mathcal S be a hidden state, Ot∈OO_t\in\mathcal O an observation, and At∈AA_t\in\mathcal A an action. Rewards Rt+1∈RR_{t+1}\in\mathcal R are observed. For this section, take all four spaces to be finite and 0≤γ<10\le\gamma<1. The finite reward set is a simplifying assumption for the sums, not part of the general definition of a POMDP.

The information available before action AtA_t is

Ht=(O0,A0,R1,O1,…,At−1,Rt,Ot).H_t=(O_0,A_0,R_1,O_1,\ldots,A_{t-1},R_t,O_t).

An admissible policy uses this history, with randomization independent of the hidden state conditional on HtH_t:

P(At=a∣Ht,St)=πt(a∣Ht).\mathbb P(A_t=a\mid H_t,S_t)=\pi_t(a\mid H_t).

We specify a joint transition–observation–reward kernel

P(St+1=s′,Ot+1=o,Rt+1=r∣St=s,Ht,At=a)=K(s′,o,r∣s,a).\begin{aligned} &\mathbb P(S_{t+1}=s',O_{t+1}=o,R_{t+1}=r \mid S_t=s,H_t,A_t=a)\\ &\hspace{4em}=K(s',o,r\mid s,a). \end{aligned}

This asserts the latent controlled Markov property and time homogeneity. The initial state has distribution ρ0\rho_0, and O0O_0 is drawn from an initial observation kernel E0(o∣s)E_0(o\mid s). Together, (S,A,O,R,K,ρ0,E0,γ)(\mathcal S,\mathcal A,\mathcal O,\mathcal R,K,\rho_0,E_0,\gamma) specifies the model used here.

For a fixed policy, Pπ\mathbb P^\pi denotes the trajectory distribution generated by S0∼ρ0S_0\sim\rho_0, O0∣S0∼E0(⋅∣S0)O_0\mid S_0\sim E_0(\cdot\mid S_0), At∣Ht∼πt(⋅∣Ht)A_t\mid H_t\sim\pi_t(\cdot\mid H_t), and (St+1,Ot+1,Rt+1)∣St,At∼K(⋅∣St,At)(S_{t+1},O_{t+1},R_{t+1})\mid S_t,A_t\sim K(\cdot\mid S_t,A_t). Probabilities in the belief derivation use this distribution. Conditioning on a realized history averages only over the remaining latent uncertainty and subsequent draws, not over a new history.

The common separate transition/emission notation is a special case. For example, under the corresponding conditional independence assumptions,

K(s′,o,r∣s,a)=P(s′∣s,a)E(o∣s′,a)q(r∣s,a,s′,o).K(s',o,r\mid s,a) =P(s'\mid s,a)E(o\mid s',a)q(r\mid s,a,s',o).

The joint kernel retains any information about the hidden state carried by observed rewards. The policy still uses its history rather than assuming that a single OtO_t summarizes the past.

Original Kaelbling, Littman and Cassandra Figure 2. A world sends an observation to a state estimator, labeled SE. The estimator updates belief b using observations, prior belief and actions. A policy maps belief to the next action, which feeds back to the world and estimator.
Figure 1. A belief-state estimator followed by a policy. Original figure from Kaelbling, Littman and Cassandra (1998), Planning and acting in partially observable stochastic domains, Figure 2. The source diagram uses action/observation updates. Our joint-kernel formulation also retains observed rewards when they carry information. Full resolution ↗Figure excerpt for discussion; copyright remains with the authors/rightsholder.

Deriving the belief update

Define the belief state

bt(s)=P(St=s∣Ht),∑sbt(s)=1.b_t(s)=\mathbb P(S_t=s\mid H_t),\qquad \sum_s b_t(s)=1.

For an initial observation of positive probability, Bayes' rule gives

b0(s)=ρ0(s)E0(O0∣s)∑uρ0(u)E0(O0∣u).b_0(s)=\frac{\rho_0(s)E_0(O_0\mid s)} {\sum_u\rho_0(u)E_0(O_0\mid u)}.

First, the policy's information restriction implies that observing the selected action adds no information about StS_t beyond HtH_t:

P(St=s∣Ht,At=a)=bt(s)\mathbb P(S_t=s\mid H_t,A_t=a)=b_t(s)

whenever the conditioning event has positive probability. The law of total probability and the kernel assumption therefore give

P(St+1=s′,Ot+1=o,Rt+1=r∣Ht,At=a)=∑sK(s′,o,r∣s,a)bt(s).\begin{aligned} &\mathbb P(S_{t+1}=s',O_{t+1}=o,R_{t+1}=r\mid H_t,A_t=a)\\ &\hspace{4em}=\sum_s K(s',o,r\mid s,a)b_t(s). \end{aligned}

Next, define the probability of the next observed pair:

c(b,a,o,r)=∑u∑sK(u,o,r∣s,a)b(s).c(b,a,o,r)=\sum_u\sum_sK(u,o,r\mid s,a)b(s).

Conditioning on (Ot+1,Rt+1)=(o,r)(O_{t+1},R_{t+1})=(o,r) and applying Bayes' rule yields

bt+1(s′)=∑sK(s′,o,r∣s,a)bt(s)c(bt,a,o,r).\boxed{ b_{t+1}(s') =\frac{\sum_s K(s',o,r\mid s,a)b_t(s)} {c(b_t,a,o,r)}. }

This update is defined when c>0c>0; its value at an impossible observation can be assigned arbitrarily. In the transition/emission special case with no additional reward information, this reduces to the usual prediction followed by observation weighting in Kaelbling et al., Section 3.3.

Why the belief is a sufficient state

Write B(b,a,o,r)B(b,a,o,r) for the updated probability vector. Conditional on Ht,At=aH_t,A_t=a, the pair (o,r)(o,r) has probability c(bt,a,o,r)c(b_t,a,o,r) and the next belief equals B(bt,a,o,r)B(b_t,a,o,r). Both depend on HtH_t only through btb_t. Thus the belief process is a controlled Markov process.

For example, let Uh(b)U_h(b) be the optimal expected return with hh decisions remaining, with U0=0U_0=0. Backward induction on this sufficient state gives

Uh(b)=max⁡a∑o,rc(b,a,o,r){r+γUh−1(B(b,a,o,r))}.U_h(b)=\max_a\sum_{o,r}c(b,a,o,r) \{r+\gamma U_{h-1}(B(b,a,o,r))\}.

Terms with c=0c=0 contribute zero. Finally, to prove optimality, consider any history with belief bb. Its next-outcome distribution is the one derived above, so no randomized action choice can exceed the displayed maximum. Applying the same argument to the remaining h−1h-1 decisions proves the claim by induction. A belief-based action attaining the maximum reaches this bound. This is the finite-horizon belief-MDP argument in Kaelbling et al., Section 3.4.

The belief recursion is exact when the specified kernels describe the process. If those kernels are unknown, estimating a belief representation introduces an additional statistical problem.

Example: The same observation can require different actions

Let a fixed hidden state S∈{0,1}S\in\{0,1\} have prior probability 1/21/2 for either value. Before a terminal decision, observe three conditionally independent signals, each equal to SS with probability 0.80.8. There are no informative rewards or choices during this passive observation period. The final action guesses SS and earns one for a correct guess and zero otherwise.

For a sequence with n1n_1 ones and n0n_0 zeros, conditional independence and Bayes' rule give posterior odds

P(S=1∣O0,O1,O2)P(S=0∣O0,O1,O2)=(0.80.2)n1−n0.\frac{\mathbb P(S=1\mid O_0,O_1,O_2)} {\mathbb P(S=0\mid O_0,O_1,O_2)} =\left(\frac{0.8}{0.2}\right)^{n_1-n_0}.

The histories (1,1,0)(1,1,0) and (0,0,0)(0,0,0) have the same current observation O2=0O_2=0, but

b(1,1,0)(1)=41+4=45,b(0,0,0)(1)=1/641+1/64=165.b^{(1,1,0)}(1)=\frac4{1+4}=\frac45,\qquad b^{(0,0,0)}(1)=\frac{1/64}{1+1/64}=\frac1{65}.

The terminal action values are Q(b,1)=b(1)Q(b,1)=b(1) and Q(b,0)=1−b(1)Q(b,0)=1-b(1). The optimal actions are therefore 1 and 0, respectively. A policy using only O2O_2 cannot implement both decisions. A policy using the posterior belief can.

3. Offline is a data-access restriction

For the next derivation, return to a fully observed finite MDP. Use a finite horizon TT and bounded rewards, so the discount may now satisfy 0≤γ≤10\le\gamma\le1. Policies may depend on the history and decision time. This is a new finite-horizon setup, not an application of Part i's infinite-horizon theorem with γ=1\gamma=1.

Suppose a behavior policy βt(a∣Ht)\beta_t(a\mid H_t) generated nn independent trajectories. The logged dataset is

D={τi}i=1n,τ=(S0,A0,R1,S1,…,AT−1,RT,ST).\mathcal D=\{\tau_i\}_{i=1}^n,\qquad \tau=(S_0,A_0,R_1,S_1,\ldots,A_{T-1},R_T,S_T).

Rewards and states within a trajectory need not be independent. Offline RL learns a policy using this fixed dataset without further environment interaction for training. Off-policy learning instead describes the relationship between the policy generating data and the target policy; it does not prohibit collecting more data. Levine et al., Figure 1 and Section 2.2 illustrate the distinction.

Original Levine et al. Figure 1. Online learning updates from current-policy rollouts. The off-policy workflow adds new rollouts to a replay buffer. Offline learning uses a dataset collected once by a behavior policy, trains without further environment interaction, and deploys afterward.
Figure 2. Online, off-policy, and offline reinforcement learning. Original figure from Levine, Kumar, Tucker and Fu (2020), Offline Reinforcement Learning: Tutorial, Review, and Perspectives on Open Problems, Figure 1. The off-policy panel illustrates continued data collection; off-policy and offline are not mutually exclusive properties of a learning method. Full resolution ↗Figure excerpt for discussion; copyright remains with the authors/rightsholder.

The behavior policy determines which trajectories enter the dataset, whether or not the learning algorithm estimates that policy. We make its role explicit in the value identity next.

An off-policy value identity

For a compact derivation, additionally take a finite reward set and write p(s′,r∣s,a)p(s',r\mid s,a) as a probability mass function. Let pβp_\beta and pπp_\pi be trajectory probabilities under behavior and target policies, with the same initial distribution and environment kernel:

pβ(τ)=ρ0(s0)∏t=0T−1βt(at∣ht)p(st+1,rt+1∣st,at),pπ(τ)=ρ0(s0)∏t=0T−1πt(at∣ht)p(st+1,rt+1∣st,at).\begin{aligned} p_\beta(\tau) &=\rho_0(s_0)\prod_{t=0}^{T-1} \beta_t(a_t\mid h_t)p(s_{t+1},r_{t+1}\mid s_t,a_t),\\ p_\pi(\tau) &=\rho_0(s_0)\prod_{t=0}^{T-1} \pi_t(a_t\mid h_t)p(s_{t+1},r_{t+1}\mid s_t,a_t). \end{aligned}

Let Pβ,PπP_\beta,P_\pi be the trajectory distributions with these mass functions. The dataset satisfies τi∼iidPβ\tau_i\overset{\mathrm{iid}}\sim P_\beta, while policy value averages τ∼Pπ\tau\sim P_\pi. Write Eβ=Eτ∼Pβ\mathbb E_\beta=\mathbb E_{\tau\sim P_\beta} and Eπ=Eτ∼Pπ\mathbb E_\pi=\mathbb E_{\tau\sim P_\pi}, with policies and environment fixed. Neither expectation averages over the process of fitting a policy.

Assume target-policy coverage: pπ(τ)>0p_\pi(\tau)>0 implies pβ(τ)>0p_\beta(\tau)>0. In particular, every target action on a target-reachable history must have positive behavior probability. Cancellation of the common environment factors gives

w(τ)=pπ(τ)pβ(τ)=∏t=0T−1πt(at∣ht)βt(at∣ht)on the support of pβ.w(\tau)=\frac{p_\pi(\tau)}{p_\beta(\tau)} =\prod_{t=0}^{T-1} \frac{\pi_t(a_t\mid h_t)}{\beta_t(a_t\mid h_t)} \quad\text{on the support of }p_\beta.

Let G(τ)=∑t=0T−1γtrt+1G(\tau)=\sum_{t=0}^{T-1}\gamma^t r_{t+1}. First substitute the ratio, then sum over trajectories:

Eβ[w(τ)G(τ)]=∑τ:pβ(τ)>0pβ(τ)pπ(τ)pβ(τ)G(τ)=∑τpπ(τ)G(τ)=J(π).\begin{aligned} \mathbb E_\beta[w(\tau)G(\tau)] &=\sum_{\tau:p_\beta(\tau)>0} p_\beta(\tau)\frac{p_\pi(\tau)}{p_\beta(\tau)}G(\tau)\\ &=\sum_\tau p_\pi(\tau)G(\tau)\\ &=J(\pi). \end{aligned}

The second equality uses coverage. This is an identity for a fixed target policy and true trajectory probabilities, consistent with the importance-sampling treatment in Levine et al., Section 3.1. If behavior probabilities are fitted, or the same data select the target policy, additional estimation and data-dependence arguments are required.

Missing coverage is an identification problem

Consider one state, one decision, and two actions. The behavior policy always chooses action 0 and obtains reward zero. Two environments agree on every possible logged observation:

EnvironmentReward for action 0Reward for action 1Optimal action
M+M_+011
M−M_-0−1-10

The logged-data distributions are identical, but the optimal actions differ. Without additional structural information, no amount of data from this behavior policy can distinguish the environments. A policy choosing action 1 lacks an identified value from these logs.

Even with positive coverage, probabilities can be small. For a fixed time tt, let dtπ(s,a)d_t^\pi(s,a) and dtβ(s,a)d_t^\beta(s,a) denote the target and behavior state–action distributions. If

dtπ(s,a)≤Ctdtβ(s,a)for every (s,a),d_t^\pi(s,a)\le C_t d_t^\beta(s,a) \quad\text{for every }(s,a),

then, for any real function ftf_t on state–action pairs,

Edtπ∣ft(S,A)∣≤Ct Edtβ∣ft(S,A)∣.\mathbb E_{d_t^\pi}|f_t(S,A)| \le C_t\,\mathbb E_{d_t^\beta}|f_t(S,A)|.

This follows by multiplying the pointwise probability inequality by ∣ft∣|f_t| and summing. Large CtC_t can amplify errors measured under the logged distribution. The inequality explains one role of coverage; it is not by itself a finite-sample policy-learning guarantee.

4. Partial observability is not the same as hidden confounding

The belief update in Section 2 used

P(St=s∣Ht,At=a)=P(St=s∣Ht).\mathbb P(S_t=s\mid H_t,A_t=a)=\mathbb P(S_t=s\mid H_t).

This is justified when the agent selects actions from recorded information and independent randomization. It can fail for historical data when the behavior policy uses additional information unavailable in HtH_t.

For example, if a decision maker observes the hidden state and chooses At=StA_t=S_t, then conditioning on the action reveals that state. A posterior that ignores this selection is incorrect. Likewise, the recorded conditional distribution of the next outcome given (Ht,At)(H_t,A_t) need not equal its distribution when the action is externally assigned.

To identify intervention values from partially observed logs, we must therefore specify what information the behavior decision maker used. A recurrent representation of OtO_t or an estimated belief can summarize recorded information, but cannot by itself justify the assumptions needed for causal identification.

5. Dynamic treatment regimes: A finite-horizon connection

Now use treatment stages t=1,…,Tt=1,\ldots,T. Let LtL_t be information observed before treatment AtA_t, and let YY be a bounded terminal outcome, with larger values preferable. For explicit formulas, assume finite covariate and treatment spaces and fully observed trajectories from independent individuals. Define

Ht=(L1,A1,L2,A2,…,At−1,Lt),d=(d1,…,dT),At=dt(Ht).H_t=(L_1,A_1,L_2,A_2,\ldots,A_{t-1},L_t),\qquad d=(d_1,\ldots,d_T),\qquad A_t=d_t(H_t).

Each dtd_t maps the available history to a feasible treatment. This is the setup of Schulte et al., Sections 2–3 and our earlier Q-learning note.

A two-stage treatment regime uses the available historyBaseline information L1 precedes treatment A1. Intermediate information L2 follows A1 and precedes A2. The second rule uses the complete history L1, A1, L2; the terminal outcome Y follows A2. Only pretreatment information enters each rule.Information available before each treatmentL₁A₁L₂A₂Yd₁(H₁), H₁ = L₁d₂(H₂), H₂ = (L₁, A₁, L₂)
Figure 3. A two-stage treatment regime uses the available history. Original timeline following the history-based setup in Schulte et al. (2014), Sections 2–3. Source.

What replaces the latest-state Markov assumption?

A history-based DTR does not require

L(Lt+1∣Ht,At)=L(Lt+1∣Lt,At).\mathcal L(L_{t+1}\mid H_t,A_t) =\mathcal L(L_{t+1}\mid L_t,A_t).

The transition may depend on all recorded past treatments and covariates. We can still use finite-horizon dynamic programming by taking the whole history, including the stage, as the state. This does not assume that the latest covariate LtL_t summarizes the past. The history space grows with tt, so this construction does not provide a low-dimensional state representation.

A terminal-outcome DTR corresponds to the following finite-horizon RL reward convention:

Rt=0 (t<T),RT=Y,γ=1.R_t=0\ (t<T),\qquad R_T=Y,\qquad \gamma=1.

Here RL's action at time t−1t-1 is treatment AtA_t, and its state before that action is HtH_t. Intermediate utilities can instead be included as rewards when that is the chosen scientific objective.

Causal identification requires separate assumptions

Let YdY^d denote the outcome under regime dd, and define its causal value by V(d)=E[Yd]V(d)=\mathbb E[Y^d]. Let W∗\mathcal W^* collect the potential covariates and outcomes under all fixed treatment sequences.

In this section, PobsP_{\mathrm{obs}} denotes the logged longitudinal distribution. Unmarked conditional means and treatment probabilities use PobsP_{\mathrm{obs}}. By contrast, E[Yd]\mathbb E[Y^d] averages the regime's potential outcome over the baseline population. Equivalently, it averages the terminal outcome under the intervention distribution PdP^d.

The assumptions below identify PdP^d from the baseline distribution and the observed conditional covariate and outcome distributions. The treatment rules dtd_t replace the logged treatment assignments. For the standard no-interference setting, assume:

  • Consistency: recorded covariates and outcome equal their potential counterparts under the treatments actually received.
  • No interference: one individual's treatments do not affect another individual's potential covariates or outcome; treatment versions are well specified.
  • Sequential exchangeability: At⊥ ⁣ ⁣ ⁣⊥W∗∣HtA_t\perp\!\!\!\perp\mathcal W^*\mid H_t at every stage. This is a strong sufficient no-unmeasured-confounding assumption.
  • Positivity: et(a∣h)=P(At=a∣Ht=h)>0e_t(a\mid h)=\mathbb P(A_t=a\mid H_t=h)>0 for treatments required by the target regime on its reachable histories.

These are the identification conditions in Schulte et al., Sections 2–3, not consequences of labeling histories as states. Evaluating one regime requires support for its own treatment choices. Optimizing over all feasible regimes requires support for every candidate treatment on each reachable history.

In the present finite-support setting, positivity gives a positive minimum over the required probabilities. It does not specify how small that minimum may be. Bounds across a sequence of data-generating models often impose a common lower bound et≥κ>0e_t\ge\kappa>0. With infinite history spaces, pointwise positivity need not imply such a uniform bound even for a single model.

Under these assumptions, externally assigning the treatments preserves the observed conditional covariate/outcome kernels. For two stages, write

μ(h2,a)=E[Y∣H2=h2,A2=a],h2=(l1,a1,l2).\mu(h_2,a)=\mathbb E[Y\mid H_2=h_2,A_2=a],\qquad h_2=(l_1,a_1,l_2).

The g-formula is

V(d)=∑l1p(l1)∑l2p(l2∣l1,d1(l1))×μ((l1,d1(l1),l2),d2(l1,d1(l1),l2)).\begin{aligned} V(d) &=\sum_{l_1}p(l_1)\sum_{l_2}p(l_2\mid l_1,d_1(l_1))\\ &\quad\times\mu\bigl((l_1,d_1(l_1),l_2), d_2(l_1,d_1(l_1),l_2)\bigr). \end{aligned}

Consistency links observed and potential variables, exchangeability identifies the intervention kernels, and positivity ensures the required conditionals are supported by the observed distribution.

The DTR recursion is a finite-horizon Bellman recursion

For the unrestricted class of history-based regimes, define

QT∗(h,a)=E[Y∣HT=h,AT=a],VT∗(h)=max⁡aQT∗(h,a),Qt∗(h,a)=E[Vt+1∗(Ht+1)∣Ht=h,At=a],Vt∗(h)=max⁡aQt∗(h,a),t=T−1,…,1.\begin{aligned} Q_T^*(h,a)&=\mathbb E[Y\mid H_T=h,A_T=a],\\ V_T^*(h)&=\max_a Q_T^*(h,a),\\ Q_t^*(h,a)&=\mathbb E[V_{t+1}^*(H_{t+1})\mid H_t=h,A_t=a],\\ V_t^*(h)&=\max_a Q_t^*(h,a),\qquad t=T-1,\ldots,1. \end{aligned}

The maximizing rules are dt∗(h)=first⁡arg⁡max⁡aQt∗(h,a)d_t^*(h)=\operatorname{first}\arg\max_aQ_t^*(h,a), using a fixed action ordering. First, the final rule maximizes the identified conditional terminal mean. Next, its optimized continuation value becomes the outcome averaged at the preceding stage. Repeating this argument backward proves optimality by the tower property and the fact that a maximum dominates any competing treatment choice. The earlier article gives the complete two-stage optimality and estimation-error proofs.

The correspondence is therefore precise: learning a finite-horizon DTR from existing longitudinal data is a history-based offline policy-learning problem, with an explicitly causal value target and identification assumptions. DTRs can also be studied in adaptive or prospectively randomized settings; the entire field is not defined by offline data access.

6. Which distinction determines the method?

Setting or choiceWhat must be specifiedWhat does not follow automatically
Fully observed MDPSufficient observed state and controlled transition/reward lawThat the model is known or one-step samples are independent
POMDPLatent dynamics, observation/reward information, admissible policy historyThat the current observation is Markov or the latent model is identified from logs
Offline learningFixed data source, target policy class, coverage and estimation conditionsThat Markov assumptions disappear or ordinary off-policy updates will suffice
History-based DTR learningFinite-stage decisions, causal outcome, feasible rules, identification conditionsThat latest covariates alone are Markov or hidden confounding is absent

These choices can coexist. A model-based algorithm can learn offline; an actor–critic algorithm can use beliefs; and a DTR can be learned by Q-learning or by the direct-learning methods discussed earlier. The information model, data-access restriction, causal assumptions, and optimization method answer different questions.

References