Part II / Reinforcement Learning
The world as an MDP
An MDP is a compact contract for a sequential decision problem: what the world contains, what the agent can do, how consequences unfold, and what counts.
States, actions, transitions, rewards, and discount.
The state contains enough history to predict the next step.
Observations usually expose only part of that state.
A board game rulebook for the world
A board game defines legal positions, moves, how a move changes the board, and how the game ends. A Markov decision process does the same for a stochastic world. The classic tuple is (S, A, P, R, gamma): possible states, actions, a transition distribution, a reward rule, and a discount factor. A policy is the player's behavior rule.
The MDP is the world contract. The policy is one strategy inside that contract. An RL algorithm is a method for improving the strategy from interaction or recorded experience.
The word Markov means the current state contains the information needed for the distribution of the next state. It does not mean the world is deterministic or memoryless in an ordinary sense. If a machine's future depends on its last ten temperature readings, those readings must be included in the state or summarized by a sufficient condition variable. State is a modeling choice about predictive information.
Write the incident as a decision process
The hidden state includes the true degraded uplink, interface counters, routing state, background traffic, earlier changes, and which facts the agent has already requested. Actions include tool queries, hypothesis updates, final answers, and perhaps requests for human approval.
A transition occurs when time advances, a tool executes, the environment reveals data, or a remediation changes the system. Some transitions are deterministic: a stored topology query returns a fixed seeded graph. Others are stochastic: a diagnostic packet may be lost, a tool may time out, or background traffic may change a measurement. The transition model P(s' | s, a) describes the distribution of possible next states after action a in state s.
The agent does not receive s. It receives an observation o generated from the state. This makes the problem a partially observable MDP, or POMDP. The policy can condition on the full interaction history, a summary memory, or a learned belief about hidden state. A transformer context is one implementation of history, not the mathematical state itself.
State, observation, and memory are different
| Object | Incident example | Who owns it |
|---|---|---|
| Environment state | Actual uplink fault and all telemetry | The world or simulator |
| Observation | Alert, tool result, timeout, approval response | Environment interface |
| Agent memory | Transcript, compressed notes, retrieved prior evidence | Policy system |
| Belief | 70% uplink fault, 20% route issue, 10% unknown | Explicit or implicit policy estimate |
These separations catch evaluation leakage. If the hidden scenario record says "cause: uplink degradation" and that field appears in a tool response, the observation contains the answer. A high score then measures extraction, not investigation. Conversely, if a required fact exists in hidden state but no legal action can reveal it, the environment punishes the agent for impossibility.
The action space also shapes difficulty. A discrete toy environment may offer QUERY_A, QUERY_B, and ANSWER. A language agent emits token sequences that are parsed into tool calls or prose. The effective action space includes tool names, arguments, free-form text, and termination. Invalid actions, retries, and parser errors are part of the environment unless the orchestration layer silently repairs them.
Model-free and model-based are about prediction
A model-based agent has or learns a model of transitions and rewards, then uses it to plan. It asks, "If I take this action, what might happen?" A model-free agent learns values or a policy without explicitly representing that predictive world model. The distinction is not the same as "uses a neural network" versus "uses rules." Both can use networks.
Tool-using language agents are awkward hybrids. The base model contains broad learned knowledge about how worlds behave, the orchestration layer may simulate outcomes, and the policy often reasons verbally about consequences. Yet an RL algorithm may still update the policy model-free from sampled returns. Classify the learning mechanism and planning interface explicitly rather than forcing the entire product into one label.
Write a one-page environment contract before choosing PPO, DPO, or any optimizer: state, observations, action schema, transition behavior, termination, reward, invalid actions, time, and reproducibility.
Markov means the chosen state is sufficient for predicting the next step. Under partial observability, the agent may need history or memory to infer that state. Throwing away history can make a Markov world non-Markov from the policy's perspective.
Episodic and continuing problems
An incident investigation has a natural episode boundary: alert to diagnosis or timeout. A production assistant serving an indefinite stream of users is a continuing process, though engineers often carve it into task episodes for training. Boundaries affect credit. If an agent's misleading answer causes a ticket escalation an hour later, ending the episode at the first response hides the consequence.
Termination must distinguish success, failure, timeout, truncation, and policy-chosen stop. In RL libraries, a time-limit truncation is not always equivalent to a terminal state with zero future value. In agent data, conflating tool timeout with deliberate completion can train premature answers. Record the termination reason alongside done=true.
References
- Sutton and Barto, chapters 3 and 17, is the primary foundation for MDPs and partial observability.
- Moerland et al. provides the model-based RL taxonomy.