Inferensys

Glossary

Markov Decision Process (MDP)

A Markov Decision Process is a discrete-time stochastic control framework that formally defines an environment for reinforcement learning, consisting of states, actions, a state-transition probability function, and a reward signal.
Control room desk with laptops and a large orchestration network display.
FOUNDATIONAL FRAMEWORK

What is Markov Decision Process (MDP)?

A Markov Decision Process is the mathematical framework for modeling sequential decision-making in stochastic environments, formally defined by a tuple of states, actions, a transition probability function, and a reward function.

A Markov Decision Process (MDP) is a discrete-time stochastic control process that provides a formal framework for modeling decision-making where outcomes are partly random and partly under the control of a decision-maker. The framework is defined by the tuple (S, A, P, R, γ), where S is a finite set of environment states, A is a finite set of available actions, P(s'|s, a) is the state transition probability function defining the dynamics of the environment, R(s, a) is the immediate reward function, and γ (gamma) is a discount factor between 0 and 1 that weights the importance of future rewards against immediate ones. The defining Markov property asserts that the future state depends solely on the current state and action, not on the history of prior states.

The objective within an MDP is to discover an optimal policy π(a|s)—a mapping from states to actions—that maximizes the expected cumulative discounted reward, known as the return. This is formalized through value functions: the state-value function V(s) estimates the expected return starting from state s and following policy π, while the action-value function Q(s, a) estimates the expected return after taking action a in state s. Solving an MDP involves computing these optimal value functions, typically via dynamic programming methods like value iteration or policy iteration when the model dynamics are fully known, or through reinforcement learning algorithms when the transition and reward functions must be learned through interaction.

FOUNDATIONAL FRAMEWORK

Core Components of an MDP

A Markov Decision Process provides the mathematical scaffolding for sequential decision-making under uncertainty. Each component defines a critical aspect of how an agent perceives, acts, and learns within an environment.

01

State Space (S)

The complete set of distinct configurations the environment can occupy. A state s ∈ S must capture all information necessary to make a decision, satisfying the Markov property—the future is conditionally independent of the past given the present state.

  • Fully Observable: The agent perceives the complete environment state (e.g., chess board position).
  • Partially Observable (POMDP): The agent receives an observation o that provides incomplete information about the true state.
  • Representation: States can be discrete grid cells, continuous vectors of sensor readings, or latent embeddings learned by a neural network.
02

Action Space (A)

The set of all possible moves or decisions available to the agent at each time step. The action space defines the agent's control authority over the environment.

  • Discrete Actions: A finite set of choices (e.g., {up, down, left, right} in a grid world).
  • Continuous Actions: A vector of real-valued parameters (e.g., joint torques for a robotic arm, throttle and steering angle for an autonomous vehicle).
  • Action Masking: Invalid actions in a given state are filtered out to prevent the agent from selecting impossible moves.
03

Transition Function (T)

The probabilistic model of environmental dynamics, denoted T(s' | s, a). It defines the probability of transitioning to state s' after taking action a in state s.

  • Deterministic Transitions: The next state is a fixed function of the current state and action (e.g., moving a piece in chess).
  • Stochastic Transitions: The outcome is governed by a probability distribution (e.g., a robot's wheel slipping on uneven terrain).
  • Model-Based RL: The agent learns or is given an explicit model of T to plan ahead. Model-Free RL learns a policy directly from sampled experience without modeling T.
04

Reward Function (R)

A scalar feedback signal R(s, a, s') emitted by the environment after each transition. The reward function encodes the desirability of state-action pairs and defines the agent's objective.

  • Dense Rewards: Frequent feedback at every step (e.g., distance to a target).
  • Sparse Rewards: Feedback only upon task completion (e.g., winning a game). These are harder to learn from but easier to specify.
  • Reward Shaping: Adding intermediate bonus rewards to guide learning without changing the optimal policy. Reward Decomposition breaks the scalar signal into sub-rewards for explainability.
05

Discount Factor (γ)

A parameter γ ∈ [0, 1] that determines the present value of future rewards. It controls the agent's planning horizon and trades off immediate versus delayed gratification.

  • γ ≈ 0: Myopic agent that cares only about immediate reward R_t.
  • γ ≈ 1: Far-sighted agent that heavily weights distant future rewards, enabling long-term planning.
  • Mathematical Role: Ensures the infinite sum of discounted returns converges for continuing (non-episodic) tasks. The return is defined as G_t = Σ_{k=0}^{∞} γ^k R_{t+k+1}.
06

Policy (π)

The agent's strategy or behavior function mapping states to actions. The policy is the decision-making core that the learning algorithm optimizes.

  • Deterministic Policy π(s): Maps each state to a single action.
  • Stochastic Policy π(a | s): Outputs a probability distribution over actions, enabling exploration.
  • Policy Gradient Methods: Directly optimize the policy parameters by ascending the gradient of expected return. Policy Distillation compresses a complex neural policy into an interpretable form like a decision tree for auditing.
MDP FUNDAMENTALS

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the mathematical framework underpinning all modern reinforcement learning systems.

A Markov Decision Process (MDP) is a formal mathematical framework for modeling sequential decision-making in stochastic environments. It is defined by a 5-tuple (S, A, P, R, γ). The process operates through discrete time steps where an agent observes a state (s ∈ S), selects an action (a ∈ A), and the environment responds by transitioning to a new state (s') according to a transition probability function (P(s'|s, a)) and emitting a numerical reward (R(s, a, s')). The discount factor (γ ∈ [0,1]) determines the present value of future rewards. The defining characteristic is the Markov property: the future state depends solely on the current state and action, not on the history of prior states. This memoryless property enables dynamic programming solutions like value iteration and policy iteration to compute optimal policies.

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.