---
title: Non-Markovian Reward Decision Processes
url: https://www.emergentmind.com/topics/non-markovian-reward-decision-processes-nmrdps
type: topic
---

# Non-Markovian Reward Decision Processes

Non-Markovian Reward Decision Processes (NMRDPs) are decision processes in which reward depends on history rather than only on the current state or transition. In the common formulation, the transition model remains Markovian while the reward is a functional over finite traces, for example $R:(S\times A)^*\to \mathbb{R}$, so optimal control generally depends on memory of past events. This history dependence breaks the standard Bellman decomposition on the original state space and motivates a large body of work on state augmentation, temporal-logic specification, reward machines, automata products, and learned internal memory that restore Markovian structure in an expanded state space [2310.11678][2406.13991][2605.10816].

## 1. Formal model and decision-theoretic foundations

A standard MDP is typically written as $M=\langle S, A, R, P, \gamma, s_0\rangle$ or $(S,A,T,R,\gamma)$, with finite state space $S$, action space $A$, transition kernel $P$ or $T$, and discount factor $\gamma$ [2310.11678][2406.13991]. An NMRDP keeps the same state and transition structure but replaces the Markovian reward with a history-dependent reward. One formulation is
$$
NM=\langle S, A, R, P, \gamma, s_0\rangle,\qquad R:(S\times A)^*\to \mathbb{R},
$$
while another writes $R:(S\times A\times S)^*\to\mathbb{R}$ or $r(h_t)\in\mathbb{R}$ for a trajectory prefix $h_t$ [2310.11678][2406.13991].

This change has immediate consequences for policies and value functions. In one common formalization, policies are themselves history dependent,
$$
\pi:(S\times A)^*\times S \to \Delta(A),
$$
and the value and action-value functions are defined on histories:
$$
V^\pi(h_t)=\mathbb{E}_\pi\left[\sum_{k=0}^{\infty}\gamma^k r(h_{t+k})\right],\qquad
Q^\pi(h_t,a)=\mathbb{E}_\pi\left[r(h_t)+\sum_{k=1}^{\infty}\gamma^k r(h_{t+k})\mid a_t=a\right].
$$
The key distinction from an MDP is therefore not uncertainty alone, but the fact that reward-relevant information is not necessarily recoverable from the current environment state [2406.13991].

Several papers place NMRDPs inside a broader non-Markovian decision-process family. In the episodic and discounted NMDP model, both observations and rewards may depend on the whole interaction history, whereas an NMRDP is the special case in which the defining non-Markovian feature is the reward $r_t(O_{1:t},A_{1:t})$ [2605.10816]. This broader view is useful because it clarifies that reward non-Markovianity and observation or transition non-Markovianity are logically distinct phenomena, even though they are often handled by similar memory-augmentation techniques.

## 2. Temporal logic, reward machines, and other specification formalisms

One influential line of work specifies non-Markovian rewards by temporal logic over finite traces. In the LTL$_f$ formulation,
$$
\phi ::= p \mid \neg \phi \mid \phi_1 \land \phi_2 \mid \bigcirc \phi \mid \phi_1 U \phi_2,
$$
with derived operators such as $\Diamond \phi \equiv \top U \phi$ and $\Box \phi \equiv \neg \Diamond \neg \phi$. A non-Markovian task is then written as a pair $\langle \phi, r\rangle$, where $r$ is delivered when the finite trace satisfies $\phi$ [2310.11678]. A representative example is the Waterworld task “touch red then green,” encoded as
$$
\phi = (\neg r \land \neg g) U \big((r \land \neg g) \land \bigcirc((\neg r \land \neg g) U g)\big).
$$

LDL$_f$ provides a more expressive regular-language view of reward specification. There the reward model is a finite set
$$
\mathcal{R}=\{(\varphi_i,r_i)\mid i=1,\ldots,m\},
$$
and the reward of a prefix $\pi$ is
$$
R(\pi)=\sum_{i=1}^{m}\big(\mathbf{1}_{\pi\models \varphi_i}\cdot r_i\big).
$$
Because LDL$_f$ captures monadic second-order logic over finite words, it strictly subsumes LTL$_f$ while remaining compatible with automata compilation [1706.08100].

A second major line uses explicit automata. Reward Machines are finite-state reward specifications over a label alphabet. In one formulation, a Reward Machine is
$$
R=(Y, y_I, \Sigma, \Gamma, \tau, \rho),
$$
where $Y$ is the finite memory state set, $y_I$ the initial state, $\Sigma$ the label alphabet, $\Gamma\subset\mathbb{R}$ a finite reward set, $\tau:Y\times\Sigma\to Y$ the transition function, and $\rho:Y\times\Sigma\to \Gamma$ the reward output [2406.13991]. Closely related Mealy-style formulations write a Mealy Reward Machine as
$$
MR=\langle U, u_0, Z, \delta_u, \delta_r\rangle,
$$
with deterministic next-state function $\delta_u$ and output function $\delta_r$ on observation symbols [2001.09293]. These models make the reward-generating memory explicit rather than implicit in logic semantics.

Classical deterministic reward machines are not the only option. Probabilistic Reward Machines (PRMs) extend reward machines to stochastic reward semantics through a probabilistic transition function $\tau:Y\times 2^{AP}\times Y\to[0,1]$ and a reward map $\rho:Y\times 2^{AP}\times Y\to\Gamma$, thereby encoding reward distributions conditioned on label histories [2107.04633]. At the opposite end of the expressivity spectrum, "Expressive Reward Synthesis with the Runtime Monitoring Language" states that RML-based Reward Machines can specify reward functions for non-regular, non-Markovian tasks by using parameterized event patterns, conditional filters, dynamic binding, and counters [2512.14617]. This suggests that finite-state regular specifications are central but not exhaustive within the broader NMRDP landscape.

## 3. Product constructions and Markovianization

The canonical solution technique for NMRDPs is to augment the environment state with memory that summarizes the reward-relevant history. For LTL$_f$ specifications, each formula can be transformed into a deterministic finite automaton
$$
\mathcal{A}_\phi=\langle Q,\Sigma,\delta,q_0,F\rangle,
$$
with label alphabet $\Sigma=2^{AP}$ and labeling function $L:S\to\Sigma$. The resulting product MDP has state space $S'=S\times Q$; in one implementation it is realized by adding a single enumerated fluent $f_Q$, giving
$$
|S'|=|Q|\times |S|.
$$
The transition and reward are
$$
T'((s,q),a,(s',q'))=
\begin{cases}
T(s,a,s') & \text{if } q'=\delta(q,L(s'))\\
0 & \text{otherwise,}
\end{cases}
$$
and
$$
R'((s,q),a,(s',q'))=
\begin{cases}
r & \text{if } q'\in F\\
0 & \text{otherwise.}
\end{cases}
$$
The same paper contrasts this linear-state encoding with prior fluent-set encodings that can induce $|S'|=2^{|Q|}\times |S|$ [2310.11678].

Reward-machine products have the same structure. Given a labeled reward-free MDP
$$
M=(S,s_I,A,T,\Sigma,L)
$$
and a reward machine
$$
R=(Y,y_I,\Sigma,\Gamma,\tau,\rho),
$$
the product MDP is
$$
M\times R=(S',s'_I,A,T',R'),
$$
with $S'=S\times Y$, $s'_I=(s_I,y_I)$,
$$
T'((s,y),a,(s',y'))=
\begin{cases}
T(s,a,s') & \text{if } y'=\tau(y,L(s'))\\
0 & \text{otherwise,}
\end{cases}
$$
and
$$
R'((s,y),a,(s',y'))=\rho(y,L(s')).
$$
The central intuition is that the reward machine state $y$ is sufficient memory: rewards are no longer functions of the whole history once $y$ is part of the Markov state [2406.13991].

The same construction extends to stochastic reward models. For a TMDP $M=(X,x_I,A,P,AP,L,R)$ and a PRM $H=(AP,\Gamma,Y,y_I,\tau,\rho)$, the product MDP has state space $X\times Y$ and transition kernel
$$
T'((x,y),a,(x',y'))=P(x,a,x')\cdot \tau(y,L(x,a,x'),y'),
$$
with reward emitted by $\rho(y,L(x,a,x'),y')$. The paper proves a product-correctness theorem stating that if $H$ encodes the stochastic reward function $R$, then the product reproduces the original joint label-reward semantics [2107.04633].

A common misconception is that Markovianization is merely a heuristic engineering trick. In the cited literature it is instead the central equivalence construction: the augmented process is intended to be reward-equivalent to the original NMRDP, and optimal policies on the product induce optimal history-dependent policies on the underlying process when the memory component is sufficient [1706.08100][2001.09293].

## 4. Learning and inferring non-Markovian reward structure

A major branch of the literature assumes that the environment dynamics are known but the non-Markovian reward model is not. One approach uses active automata learning. "Learning Non-Markovian Reward Models in MDPs" models the reward as a Mealy machine synchronized with a known non-rewarding MDP and learns it with Angluin’s $L^*$ algorithm, using membership queries answered through interaction and equivalence queries approximated by conformance testing [2001.09293]. The same paper cites a query bound of
$$
O(|\Sigma|^2 + |\Sigma|mn^2),
$$
where $|\Sigma|$ is the alphabet size, $n$ the number of states of the minimal target Mealy machine, and $m$ the maximum counterexample length.

"Online Learning of Non-Markovian Reward Models" adapts this active-learning scheme to an online control loop. It plans specifically to answer membership queries by synthesizing policies that maximize the probability of realizing a query word or minimize the expected number of steps to realize it, then alternates learning and exploitation in the synchronized product MDP. It proves that, if the expert baseline value $V_{\mathrm{expert}}$ does not exceed the true optimal value, then with probability $1$ the algorithm eventually learns a hypothesis $\mathcal{H}$ such that $V(\pi^*_{\mathcal{H}})\ge V_{\mathrm{expert}}$ [2009.12600].

A different perspective infers the reward model directly from demonstrations. In "Bayesian Inverse Reinforcement Learning for Non-Markovian Rewards," the hypothesis space is the set of reward machines with fixed size $n$ over a label alphabet $\Sigma$ and reward alphabet $\Gamma$. Demonstrations are augmented with label prefixes,
$$
D=\{(s_i,\lambda_i,a_i): i=1..N\},
$$
and the posterior is
$$
p(R\mid D)\propto p(D\mid R)p(R),
$$
with Boltzmann likelihood
$$
\pi_R(a\mid s,y)\propto \exp(\alpha Q_R(s,y,a)).
$$
Planning inside each candidate reward machine uses policy iteration on the product MDP, and MAP inference uses a modified simulated annealing rule that preserves prior influence even when the likelihood ratio is sharp [2406.13991].

When rewards themselves are stochastic, "Inferring Probabilistic Reward Machines from Non-Markovian Reward Processes for Reinforcement Learning" replaces deterministic reward machines with PRMs and adapts $L^*$-style inference to empirical reward distributions. It introduces a sampling observation table, Hoeffding-style statistical compatibility tests, and a hypothesis PRM whose transitions are estimated from empirical counts. The paper proves almost-sure convergence to a correct PRM, or equivalence on the observable sub-language, under the stated assumptions [2107.04633].

Partial observability requires richer memory models. "Inferring Reward Machines and Transition Machines from Partially Observable Markov Decision Processes" introduces Transition Machines (TMs) for non-Markovian observation dynamics, Reward Machines for non-Markovian rewards, and a unified Dual-Behavior Mealy Machine (DBMM). Its passive state-merging algorithm DB-RPNI learns minimal resolvent DBMMs under structure completeness and achieves speedups of up to three orders of magnitude over the stated baselines [2508.01947]. This broadens reward-model inference from fully observable NMRDPs to deterministic POMDP settings in which reward memory alone is insufficient.

## 5. Planning, reinforcement learning, and optimization algorithms

Once an NMRDP has been Markovianized, classical planning methods become applicable. Earlier translation-based work studies PLTL and future-oriented FLTL reward specifications, regression and progression operators, and explicit or symbolic translations into equivalent MDPs. "Decision-Theoretic Planning with non-Markovian Rewards" implements dynamic programming, heuristic search, and structured methods in NMRDPP, while "Anytime State-Based Solution Methods for Decision Processes with non-Markovian Rewards" develops an FLTL progression-based translation aimed at LAO*, RTDP, and LRTDP, proving that the resulting expanded MDP is blind minimal in the sense relevant to anytime forward search [1109.2355][1301.0606]. The practical conclusion of this line is that the choice of temporal formalism and translation regime materially affects expansion size, reachability pruning, and suitability for explicit versus structured solvers.

More recent work integrates automata products directly with deep RL. "Using Experience Classification for Training Non-Markovian Tasks" encodes LTL$_f$ goals in a product MDP, trains SAC and TD3 in the encoded environment, and replaces TD-error prioritization with automata-guided experience classification. The shaping term is
$$
\mathcal{R}(s_t,a_t,s_{t+1}) = R(s_t,a_t,s_{t+1}) + \gamma \rho(q') - \rho(q),
$$
and replay priorities are driven by DFA-state ranks rather than by TD error. The paper reports that EC consistently accelerates learning relative to BASE, RS, and PER across tasks, except for the simplest Waterworld task with SAC where EC≈BASE, and that the single-fluent encoding yields an average training-time reduction ≈ 12.23% [2310.11678].

A distinct response dispenses with external automata and learns internal memory jointly with control. "Policy Gradient Methods for Non-Markovian Reinforcement Learning" introduces Agent State-Markov policies, in which an internal state $S_t$ is recursively updated and actions are chosen from $S_t$. For episodic problems, the paper proves
$$
\nabla_\theta J(\theta)=\mathbb{E}_{\pi_\theta,\mu}\left[\sum_{t=1}^{H} R_{t:H}\,\nabla_\theta \log \pi_{\theta,t}(S_t,A_t\mid S_{t-1},A_{t-1},O_t)\right],
$$
and analogously for discounted infinite-horizon problems. The resulting ASMPG algorithm has finite-time and almost-sure convergence guarantees under the stated smoothness assumptions, and empirically outperforms predictive-objective baselines on the reported non-Markovian tasks [2605.10816]. This provides an end-to-end memory-learning alternative to symbolic Markovianization.

Model-based RL with explicit reward machines has also acquired formal sample-efficiency guarantees. "Model-Based Reinforcement Learning in Discrete-Action Non-Markovian Reward Decision Processes" introduces QR-MAX, which factorizes learning of the Markovian environment transition model from learning of the non-Markovian reward-machine component. Its PAC-MDP sample complexity scales as
$$
\tilde{O}\left(\frac{|S||A| + |S||U|}{\epsilon^3(1-\gamma)^3}\right),
$$
improving over naïvely applying R-Max to the product MDP, which would scale with $\tilde{O}(|S||U||A|/[\epsilon^3(1-\gamma)^3])$ [2512.14617]. In the same paper, the SimHash-based Bucket-QR-MAX extends the factorized construction to continuous state spaces without manual gridding.

## 6. Generalizations, misconceptions, and open limitations

NMRDPs sit inside a larger family of history-dependent control models. Regular Decision Processes (RDPs) extend MDPs with regular lookback conditions on rewards and transitions; their expressive power coincides with finite-state MDPs because the relevant history can be compiled into a finite automaton state [2312.08602]. In grid-world studies of RDPs, the state is augmented with reward and transition automata, yielding a product space $S\times Q_R\times Q_T$; the results show that sparse non-Markovian rewards degrade model-free learning, that automata-based reward shaping improves exploration, and that even modest non-Markovian transition structure can significantly complicate learning [2111.03647].

Omega-Regular Decision Processes go further by adding omega-regular lookahead constraints interpreted as promises about future behavior. Their payoff is lexicographic:
$$
\mathrm{Lex}(\pi)=\left(\Pr^\pi[\omega\in L],\; \mathbb{E}^\pi\left[\sum_{t=0}^{\infty}\gamma^t r(s_t,a_t)\mid \omega\in L\right]\right),
$$
so the optimization problem is no longer merely “maximize discounted reward,” but “maximize satisfaction probability first, then optimize reward conditioned on satisfaction” [2312.08602]. This clarifies that non-Markovian reward is only one axis of non-Markovianity studied in the literature.

Partial observability is another major fault line. In the DBMM framework, an RM state $u$ Markovizes rewards while a TM state $q$ Markovizes observation dynamics, giving an augmented product state space $X=O\times U\times Q$ and Bellman backup
$$
V(o,u,q)=\max_{a\in A}\big[\delta_R(u,o,a)+\gamma V(\delta_P(q,o,a),\delta_U(u,L(o)),\delta_Q(q,L(o)))\big].
$$
This shows that a reward-only augmentation is not, in general, sufficient under partial observability [2508.01947].

Several limitations recur across the literature. Automata-based approaches often assume deterministic labeling and finite-trace semantics; larger automata increase memory and training time; sparse acceptance rewards remain difficult even with shaping; and partial observability is frequently outside the base model [2310.11678]. Bayesian IRL formulations commonly assume known environment dynamics, a fixed reward alphabet $\Gamma$, and a fixed reward-machine size $n$ [2406.13991]. DBMM inference currently targets deterministic POMDPs with clean traces and meaningful labels [2508.01947]. Policy-gradient memory-learning methods avoid symbolic specification but use high-variance likelihood-ratio estimators and do not yet resolve off-policy sample efficiency in non-Markovian settings [2605.10816].

A final misconception is that all non-Markovian reward formalisms are confined to regular languages. The RML work explicitly states that classical reward machines are typically bounded by regular languages, whereas its runtime-monitoring extension can specify reward functions for non-regular, non-Markovian tasks through counting and parameterized conditions [2512.14617]. A plausible implication is that future work on NMRDPs will continue to split along two complementary directions: stronger symbolic languages for specifying temporal reward structure, and stronger learned-memory methods for discovering the relevant structure directly from interaction or demonstration.

Source: https://www.emergentmind.com/topics/non-markovian-reward-decision-processes-nmrdps