Automated Generation of MDPs Using Logic Programming and LLMs for Robotic Applications

Enrico Saccon, Davide De Martini, Matteo Saveriano, Edoardo Lamon, Luigi Palopoli, Marco Roveri

Here is a concise, engaging summary of the paper, tailored for a technically literate audience.

TL;DR

This paper introduces a framework that bridges the gap between informal natural language and rigorous formal planning in robotics. By leveraging Large Language Models (LLMs) to translate natural language descriptions into structured Prolog knowledge bases, the system automatically constructs Markov Decision Processes (MDPs) and synthesizes optimal, verifiable execution policies using the Storm model checker.

What Problem Does This Paper Address?

Operating robots in unpredictable environments—especially alongside humans—requires planning frameworks that account for uncertainty. Markov Decision Processes (MDPs) are excellent for this, providing a mathematical framework to determine optimal actions under stochastic conditions. However, building symbolic MDP models is notoriously difficult, time-consuming, and requires deep expertise to translate informal, real-world scenarios into precise mathematical representations.

While LLMs have emerged as powerful tools for understanding natural language descriptions of tasks, using them as standalone planners lacks predictability and safety guarantees. This paper addresses the challenge of creating a scalable, reliable pipeline that transforms informal natural language descriptions into formally verified, executable robotic policies.

Methods

The authors design a multi-step pipeline that combines the semantic flexibility of LLMs with the mathematical rigor of formal verification:

  1. Incremental KB Generation: Instead of generating an entire model in one pass, the framework uses an LLM (tested with GPT-4o and GPT-5-mini) via few-shot prompting to incrementally build a Prolog Knowledge Base (KB). It generates the initial state, then the actions, and finally the reward functions, feeding previous outputs back into the prompt to maintain structural consistency.
  2. Reward Structuring: The LLM separates rewards into necessary conditions (hard constraints like safety boundaries, which incur heavy penalties if violated) and sufficient conditions (soft preferences, like minimizing delay).
  3. MDP Generation: A custom Prolog-based module performs a complete reachability analysis from the initial state, exhaustively grounding predicates to build a state-transition graph. It automatically distributes action probabilities across newly discovered states.
  4. Policy Synthesis: The framework compiles the graph into the PRISM formalism. The state-of-the-art Storm model checker then processes this file to synthesize an optimal policy, exported as a straightforward state-action table for execution in environments like ROS2.
General diagram of the automated MDP generation framework.

Datasets

The framework does not rely on traditional training datasets; instead, it utilizes few-shot prompting with curated examples. To evaluate its generalization capabilities, the authors designed fifteen distinct test scenarios across three diverse robotic domains:

  • Structure Building: A human-robot collaborative blocks-world task where a robot places blocks on a tray and a human builds towers.
  • Traffic Management of AGVs: An Autonomous Guided Vehicle navigating factory floor sections populated by workers, balancing speed against the risk of emergency stops.
  • Gripper Domain: A classic planning benchmark where a dual-gripper robot moves balls between rooms under energy and capacity constraints.

Key Insights and Ideas

  • LLMs as Translators, Not Planners: Rather than trusting an LLM to directly output a plan, the framework uses the LLM as a translator into formal logic (Prolog). This retains the LLM's flexibility while delegating the actual planning to a deterministic, verifiable model checker.
  • The Power of Incremental Prompting: Generating the KB in sequential steps (States $\rightarrow$ Actions $\rightarrow$ Rewards) drastically reduces hallucination and terminology mismatch compared to single-pass generation.
  • Automated Probability Splitting: When an action's abstract effect maps to multiple concrete grounded states, the custom Prolog compiler automatically splits the transition probabilities uniformly, ensuring mathematical validity without requiring the LLM to understand the underlying state-space size.
Example of how the framework uniformly distributes transition probabilities across grounded states.

Key Results

The framework was evaluated quantitatively in simulation and qualitatively on real hardware:

  • Model Performance: While GPT-4o made minor syntax errors in complex scenarios (e.g., the Gripper domain), GPT-5-mini achieved a perfect score, generating 100% correct KBs across all test cases without any manual corrections.
  • Computational Efficiency: For small-to-medium state spaces (like the AGV domain with 35–189 states), MDP extraction took less than a millisecond. Larger state spaces (like Structure Building with 1,024 states) required up to 28 seconds for reachability analysis, primarily driven by the complexity of refining transition probabilities.
  • Real-World Validation: The authors successfully deployed the synthesized policies on a physical UR5e robotic arm interacting with human subjects in the structure-building task, confirming that the generated policies are robust and executable in real time.
The physical experimental setup used for the human-robot collaborative structure building scenario.

Limitations and Future Work

Despite its success, the framework has a few notable limitations:

  • Lack of Self-Correction: The current pipeline lacks an automated feedback loop to catch and repair syntax or logical errors if the Prolog interpreter fails.
  • Probability Sourcing: The framework cannot autonomously infer transition probabilities from raw environment observations; they must still be explicitly stated in the natural language prompt or provided by an expert.
  • Full Observability Assumption: The system currently assumes a fully observable environment (MDP). The authors note that extending this framework to Partially Observable MDPs (POMDPs) is a critical direction for handling more realistic, noisy sensor data in future work.

Summary updated

BibTeX
@article{saccon2026automated,
  author = {Enrico Saccon and Davide De Martini and Matteo Saveriano and Edoardo Lamon and Luigi Palopoli and Marco Roveri},
  title = {{Automated Generation of MDPs Using Logic Programming and LLMs for Robotic Applications}},
  journal = {IEEE Robotics Autom. Lett.},
  year = {2026},
  doi = {10.1109/lra.2025.3643276},
}
Figure