[Paper Review] Learning Non-Markovian Reward Models in MDPs
This paper proposes an active learning framework that uses Angluin's L* algorithm to infer Mealy Reward Machines (MRMs)—finite automata modeling non-Markovian rewards—in Markov Decision Processes (MDPs). The method combines automata inference with MDP optimization to learn and exploit history-dependent rewards, achieving perfect learning of toy MRM examples within seconds, with formal guarantees under mild assumptions.
There are situations in which an agent should receive rewards only after having accomplished a series of previous tasks. In other words, the reward that the agent receives is non-Markovian. One natural and quite general way to represent history-dependent rewards is via a Mealy machine; a finite state automaton that produces output sequences (rewards in our case) from input sequences (state/action observations in our case). In our formal setting, we consider a Markov decision process (MDP) that models the dynamic of the environment in which the agent evolves and a Mealy machine synchronised with this MDP to formalise the non-Markovian reward function. While the MDP is known by the agent, the reward function is unknown from the agent and must be learnt. Learning non-Markov reward functions is a challenge. Our approach to overcome this challenging problem is a careful combination of the Angluin's L* active learning algorithm to learn finite automata, testing techniques for establishing conformance of finite model hypothesis and optimisation techniques for computing optimal strategies in Markovian (immediate) reward MDPs. We also show how our framework can be combined with classical heuristics such as Monte Carlo Tree Search. We illustrate our algorithms and a preliminary implementation on two typical examples for AI.
Motivation & Objective
- Address the challenge of learning non-Markovian reward functions in MDPs, where rewards depend on state/action history rather than just current state.
- Overcome the limitation of traditional MDPs that rely on immediate, Markovian rewards, which fail to capture complex, sequence-dependent tasks.
- Develop a formal, guaranteed method to infer the underlying reward machine structure from interactions with the environment.
- Enable optimal policy synthesis under non-Markovian rewards by combining automata learning with standard MDP solution techniques.
- Demonstrate the feasibility and correctness of the approach on practical AI examples with formal verification and empirical evaluation.
Proposed method
- Represent non-Markovian rewards using Mealy Reward Machines (MRMs), which map state-action sequences to rewards via finite-state automata.
- Apply Angluin’s L* active learning algorithm to infer the MRM structure through membership and equivalence queries on state-action observations.
- Use formal testing techniques to validate the conformance of hypothesized MRMs against the true reward function.
- Integrate the learned MRM into the MDP to compute optimal policies using standard Markovian MDP solvers (e.g., value iteration, policy iteration).
- Combine the framework with classical planning techniques such as Monte Carlo Tree Search (MCTS) for scalable deployment.
- Implement a practical pipeline where the agent performs random exploration to gather data, then uses L* to infer the MRM structure and optimize policies.
Experimental results
Research questions
- RQ1Can non-Markovian reward functions be actively and correctly learned in MDPs using formal automata inference?
- RQ2How can the learned MRM be effectively integrated into MDP planning to derive optimal policies?
- RQ3What is the sample and time efficiency of learning MRMs in practical environments with history-dependent rewards?
- RQ4Can the framework be combined with existing planning algorithms like MCTS to scale to larger problems?
- RQ5Under what conditions can the L* algorithm guarantee correct inference of the underlying MRM structure?
Key findings
- The proposed framework successfully learns the perfect MRM in the Cookie Domain example in approximately one second per trial, with 100% accuracy across ten trials.
- In the Cookie Domain, the agent achieved a return of $1459 \pm 376$ with an average training time of $174 \pm 59$ seconds under the APF (active policy framework) setting.
- The method correctly inferred the MRM structure in all experimental runs, demonstrating the feasibility of active learning for non-Markovian rewards.
- The framework supports integration with MCTS and other classical heuristics, enabling scalable policy learning in complex environments.
- The approach provides formal guarantees on correctness and completeness of MRM inference under mild assumptions, leveraging the theoretical foundation of L*.
- The results show that MRMs can model complex, sequence-dependent rewards—such as avoiding dangerous assembly sequences in EV battery production—that are inexpressible with standard immediate rewards.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.