Papers
Topics
Authors
Recent
Search
2000 character limit reached

Pushdown Reward Machines in RL

Updated 18 May 2026
  • Pushdown reward machines (pdRMs) are formal models that augment classical reward machines with a pushdown stack to encode deterministic context-free reward functions.
  • They extend deterministic finite automata to deterministic pushdown automata, enabling reinforcement learning agents to handle temporally extended, non-Markovian tasks.
  • Empirical evaluations across domains like LetterEnv and TreasureMaze demonstrate that top-k pdRM policies achieve efficient state-space management and improved learning performance.

A pushdown reward machine (pdRM) is a formal model augmenting the classical reward machine architecture with a pushdown stack, thereby enhancing its expressive power for encoding non-Markovian reward functions in reinforcement learning. By generalizing reward machines (which correspond to deterministic finite automata) to deterministic pushdown automata with an associated reward function, pdRMs can recognize and assign rewards for behaviors described by deterministic context-free languages, a strict superset of regular languages. This increased expressivity enables reinforcement learning agents to solve a significantly broader class of temporally extended tasks while preserving a principled automata-theoretic foundation (Varricchione et al., 9 Aug 2025).

1. Formal Structure of Pushdown Reward Machines

A pushdown reward machine is a tuple

R=(U,u0,F,Σ,Γ,Z,δ,ρ)R = \bigl(U, u_0, F, \Sigma, \Gamma, Z, \delta, \rho\bigr)

with the following components:

  • UU: finite set of machine states.
  • u0Uu_0 \in U: initial machine state.
  • FUF \subseteq U: set of accepting (final) states.
  • Σ\Sigma: finite input alphabet. Σϵ=Σ{ϵ}\Sigma_\epsilon = \Sigma \cup \{\epsilon\}.
  • Γ\Gamma: finite stack alphabet. Γϵ=Γ{ϵ}\Gamma_\epsilon = \Gamma \cup \{\epsilon\}.
  • ZΓZ \in \Gamma: initial stack symbol.
  • δ:U×Σϵ×Γϵ(UF)×Γ\delta : U \times \Sigma_\epsilon \times \Gamma_\epsilon \to (U \cup F) \times \Gamma^*: deterministic transition function. For UU0, UU1 denotes moving from state UU2 to UU3, popping UU4 (unless UU5), and pushing UU6.
  • UU7: immediate-reward function emitted during a transition.

This automaton can perform silent (UU8) moves and stack-zero checks (UU9 or u0Uu_0 \in U0), facilitating standard deterministic pushdown automaton transitions such as arbitrary stack pops/pushes and conditional stack operations.

2. Expressivity: From RMs to pdRMs and Beyond

Classical reward machines (RMs) capture only regular reward structures, corresponding to deterministic finite automata (DFAs) and thus limited to regular languages. The addition of a single pushdown stack (in pdRMs) elevates their expressivity to deterministic pushdown automata (DPDAs), i.e., the class of deterministic context-free languages (DCFLs). This is a strict superset of regular languages, enabling pdRMs to reward temporally extended behaviors that are inexpressible by regular automata.

Model Automaton Type Language Class
RM DFA Regular languages
pdRM DPDA Deterministic context-free languages (DCFL)
CRA (u0Uu_0 \in U1 ctrs) Full counter Recursively enumerable

This increased expressivity remains short of counter reward automata (CRAs) with multiple counters, which can encode any recursively enumerable reward structure but at greater space and computation cost (Varricchione et al., 9 Aug 2025).

3. Policy Classes and State Representations

In reinforcement learning settings, the product MDP induced by combining an MDP with a pdRM leads to an augmented state space

u0Uu_0 \in U2

Two canonical policy classes over this space are defined:

  • Full-stack policy: u0Uu_0 \in U3, where the learned policy can access the entire stack.
  • Top-u0Uu_0 \in U4 policy: u0Uu_0 \in U5, where only the top u0Uu_0 \in U6 stack symbols are observable.

Formally, two product-states u0Uu_0 \in U7 and u0Uu_0 \in U8 are equivalent for a top-u0Uu_0 \in U9 policy iff their top-FUF \subseteq U0 stack prefixes match.

A proposition addresses the sufficiency of top-FUF \subseteq U1 policies: if the optimal full-stack value function and action preferences agree across stack strings sharing their top-FUF \subseteq U2 slice, then the optimal policy can be implemented using only these FUF \subseteq U3 symbols, yielding a large reduction in policy space complexity (Varricchione et al., 9 Aug 2025).

4. Theoretical Properties: Expressiveness and Space Complexity

The expressive hierarchy and corresponding space considerations are as follows:

  • Expressive Power (Theorem 1):
    • RMs ≡ DFAs ⇒ regular languages.
    • pdRMs ≡ DPDAs ⇒ DCFLs (strict superset).
    • CRAs (≥2 counters) ⇒ recursively enumerable (strict superset of DCFLs).
  • State-space blow-up (Theorem 2): For episode length FUF \subseteq U4, push width FUF \subseteq U5, and max push-only FUF \subseteq U6-steps FUF \subseteq U7, there are at most

FUF \subseteq U8

reachable stack configurations, demonstrating exponential growth with stack alphabet size and episode horizon.

  • Policy complexity (Theorem 3): For a top-FUF \subseteq U9 policy, only Σ\Sigma0 stack views are necessary, dramatically reducing the size of policy representations. For Σ\Sigma1, this is linear in Σ\Sigma2.
  • Pushdown vs. Counter Automata (Theorem 4): Any DCFL can be encoded by a 1-counter CRA at exponential cost, and certain languages (e.g., marked palindromes) force a Σ\Sigma3-counter machine to Σ\Sigma4 configurations, highlighting the succinctness of pushdown stacks for such tasks.

These results collectively establish that pdRMs improve expressivity over RMs while maintaining more tractable state representations than general counter automata (Varricchione et al., 9 Aug 2025).

5. Empirical Evaluation: Domains and Findings

pdRMs were evaluated across five domains, comparing various policy and automaton configurations:

  • LetterEnv: Requires counting a sequence of Σ\Sigma5s until an event Σ\Sigma6, then matching the count with Σ\Sigma7s. Top-1-pdRM matches or exceeds the performance of CQL-CRA and outperforms both full-pdRM and Q-CRA, demonstrating competitive sample efficiency with smaller state spaces.
  • 1-TreasureMaze: Agents must find treasure then retrace their paths. On large mazes (10x10, 20x20), only top-1-pdRM converges; full-pdRM state space is too large, and CRAs experience counter state explosion.
  • MultipleTreasureMaze: Collection and retracing of multiple treasures. Only pdRMs are tractable; top-1-pdRM learns reliably, full-pdRM does not converge within resource constraints.
  • DeliverWorld: Sequential item delivery, using hierarchical RL with pdRMs. Hierarchical top-1 and top-2 policies yield order-of-magnitude faster convergence. Top-2 is faster for long sequences; top-1 generalizes better from shorter to longer tasks.
  • WaterWorld: Continuous control, requiring phased stack manipulations. Only pdRM-enhanced agents can solve the full task; recurrent agents (PPO, PPO+LSTM) underperform.

A summary of empirical findings is provided below:

Domain Key Result Policy/Automaton
LetterEnv Top-1-pdRM ≃ CQL-CRA; smaller state space Top-1-pdRM, CQL-CRA
1-TreasureMaze Only top-1-pdRM solves large instances Top-1-pdRM
MultipleTreasure Only pdRMs tractable; top-1-pdRM learns reliably Top-1-pdRM
DeliverWorld Hierarchical top-1/top-2 much faster; top-1 generalizes better Hierarchical pdRM policies
WaterWorld Only pdRM-augmented agent reliably solves task PPO + top-1-pdRM

These experiments reinforce the practical advantages of top-Σ\Sigma8 pdRM policies for balancing expressivity and tractability in RL tasks with context-free structure (Varricchione et al., 9 Aug 2025).

6. Practical Implications and Research Outlook

Pushdown reward machines furnish a principled, automata-theoretic mechanism for specifying non-Markovian reward structures beyond regular languages while maintaining concise and expressive policy representations. Key implications include:

  • Strict expressivity gains over RMs, while avoiding the combinatorial state explosion characteristic of multi-counter CRAs.
  • For many practical tasks, even a top-1 pdRM suffices for optimal or near-optimal behavior, resulting in product state spaces of size Σ\Sigma9.
  • Hierarchical policy architectures and counterfactual learning methods promise further improvements in efficiency.
  • Symbolic stack representations in pdRMs can outperform recurrent neural baselines in continuous and context-free RL domains.

A plausible implication is that pdRMs offer a scalable and expressive formalism, opening new avenues for specifying and learning temporally extended behaviors in complex reinforcement learning environments, especially where context-free reward dependencies are inherent (Varricchione et al., 9 Aug 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Pushdown Reward Machines (pdRMs).