Inferensys

Glossary

Markov Decision Process (MDP)

A mathematical framework for modeling sequential decision-making in a stochastic environment, defined by states, actions, transition probabilities, and rewards.
Governance lead reviewing model governance framework on laptop, policy documents visible, executive office setup.
SEQUENTIAL DECISION FRAMEWORK

What is Markov Decision Process (MDP)?

A Markov Decision Process is the mathematical foundation for modeling optimal decision-making in environments where outcomes are partly random and partly under the control of a decision-maker.

A Markov Decision Process (MDP) is a formal mathematical framework for modeling sequential decision-making in a stochastic environment, defined by a tuple (S, A, P, R, γ). An agent observes the current state (S), selects an action (A), and the environment transitions to a new state according to a transition probability (P), emitting a numerical reward (R). The Markov property ensures the next state depends solely on the immediate state and action, not the full history.

The objective is to discover an optimal policy (π) that maximizes the expected cumulative discounted reward over time. The discount factor (γ) balances immediate versus future rewards. MDPs are the theoretical backbone of Reinforcement Learning (RL) and are directly applied in last-mile logistics to model dynamic dispatching, where a vehicle's location is the state, routing choices are actions, and on-time delivery is the reward signal.

FOUNDATIONAL FRAMEWORK

Core Components of an MDP

A Markov Decision Process provides the mathematical scaffolding for sequential decision-making under uncertainty. Each component defines how an agent perceives its world, makes choices, and learns from outcomes.

01

State Space (S)

The complete set of distinct situations the agent can encounter. A state must capture all relevant information for decision-making, satisfying the Markov property—the future depends only on the current state, not the history.

  • Example: In last-mile delivery, a state might encode the vehicle's current grid location, remaining capacity, and the set of undelivered parcels.
  • Design: A compact, informative state representation is critical; omitting key variables (like remaining driver hours) breaks the Markov assumption and degrades policy quality.
02

Action Space (A)

The set of all possible moves the agent can execute in a given state. Actions can be discrete or continuous and are the agent's only mechanism for influencing the environment.

  • Discrete Actions: Navigate north, south, east, west on a grid; accept or reject a new order.
  • Continuous Actions: Apply a specific steering angle and acceleration value.
  • Constraint: The set of available actions may be state-dependent (e.g., you cannot 'deliver' if the vehicle is empty).
03

Transition Probability (P)

The core stochastic element, defining the probability of moving from state s to state s' after taking action a. It is formally expressed as P(s' | s, a).

  • Deterministic vs. Stochastic: In a deterministic grid world, 'move north' always succeeds. In a stochastic delivery model, 'dispatch to zone A' has a 70% chance of on-time arrival and a 30% chance of delay due to traffic.
  • Model-Based vs. Model-Free: If the transition function is known, the agent can plan internally. If unknown, the agent must learn it through real-world interaction.
04

Reward Function (R)

A scalar feedback signal received after transitioning from state s to s' via action a. It defines the goal, not how to achieve it. The agent's objective is to maximize the cumulative discounted reward over time.

  • Sparse Rewards: +100 for successful delivery, 0 otherwise. Simple but hard to learn from.
  • Dense Rewards: -1 per time step (penalizing delay), +10 for each parcel dropped off. Provides constant learning signal.
  • Shaping: Carefully designing intermediate rewards is essential for guiding the agent toward the terminal goal in complex routing problems.
05

Policy (π)

The agent's brain—a mapping from states to actions. It dictates the behavior: π(a|s) is the probability of selecting action a in state s. The goal of solving an MDP is to find the optimal policy π*.

  • Deterministic Policy: In state s, always take action a (e.g., always turn right at this intersection).
  • Stochastic Policy: In state s, take action a1 60% of the time and a2 40% of the time. Useful for exploration and optimal play in games like rock-paper-scissors.
06

Discount Factor (γ)

A value between 0 and 1 that determines the present value of future rewards. A reward received k steps in the future is worth γᵏ times its immediate value.

  • γ ≈ 0 (Myopic): The agent aggressively prioritizes immediate rewards, ignoring long-term consequences. A delivery agent might refuse a slightly out-of-the-way pickup even if it leads to a high-value chain.
  • γ ≈ 1 (Farsighted): The agent values future rewards almost as much as immediate ones, enabling long-term strategic planning like repositioning an empty vehicle to a high-demand area.
CORE CONCEPTS

Frequently Asked Questions

Clear, technically precise answers to the most common questions about Markov Decision Processes and their role in sequential decision-making under uncertainty.

A Markov Decision Process (MDP) is a mathematical framework for modeling sequential decision-making in environments where outcomes are partly random and partly under the control of a decision-maker. An MDP is formally defined by a 5-tuple: a finite set of states (S), a finite set of actions (A), a transition probability function P(s'|s,a) that defines the probability of moving to state s' after taking action a in state s, a reward function R(s,a) that provides immediate feedback, and a discount factor γ (gamma) between 0 and 1 that balances immediate versus future rewards. The defining characteristic is the Markov property—the future depends only on the current state and action, not on the history of how that state was reached. The objective is to find an optimal policy π(s) that maps states to actions to maximize the expected cumulative discounted reward over time.

SEQUENTIAL DECISION-MAKING PARADIGMS

MDP vs. Related Optimization Frameworks

A comparison of mathematical frameworks used for modeling sequential decision-making under uncertainty, highlighting their core assumptions and applicability to last-mile logistics.

FeatureMarkov Decision Process (MDP)Multi-Armed Bandit (MAB)Contextual Bandit

State Dependency

Full state transitions; next state depends on current state and action

Stateless; each decision is independent of previous actions

State represented as a context vector; no sequential state transitions

Feedback Loop

Delayed reward; actions affect future states and long-term cumulative return

Immediate reward; no impact on future decision scenarios

Immediate reward; context changes but is not influenced by the agent's actions

Exploration vs. Exploitation

Balanced via policy iteration; explores state-action space for optimal long-term trajectory

Balanced to minimize regret over independent trials

Balanced by learning context-reward mappings to minimize regret

Modeling Horizon

Infinite or finite horizon with discount factor

Fixed number of independent trials

Fixed number of independent trials with varying contexts

Optimal Policy Goal

Maximize expected cumulative discounted reward

Maximize total reward by identifying the single best arm

Maximize total reward by selecting the best arm for each specific context

Transition Probability Matrix

Last-Mile Application

Dynamic re-routing of a vehicle where each decision changes its location and future delivery windows

A/B testing delivery time slot offerings to find the single most accepted option

Selecting the optimal delivery time slot for a specific customer based on their historical preferences and location

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.