A field guide for AI engineers
Two Loops,
One Machine
Reinforcement learning asks how a policy improves through experience. Inference engineering asks how that policy produces useful tokens reliably, quickly, and economically. Agent systems make the two loops inseparable, especially when a policy must reason, call tools, learn from trajectories, and serve users under real latency and cost constraints.
This guide was compiled and put together to serve as a roadmap to help me better understand RL and inference. Hope you find it instructive. This conversation was the genesis for looking at RL and inference as tightly related loops.
The entire argument in one picture
A deployed policy serves tasks. Some trajectories become governed experience. A training system turns selected experience into a candidate policy. The candidate returns to serving only after it passes evaluation. Inference generates production answers, rollout data, evaluator judgments, and sometimes draft tokens. That shared machinery is why RL and inference teams increasingly care about the same queues, runtimes, sandboxes, model versions, and cost curves.
The terrain
RL includes bandits, value learning, policy gradients, actor-critic, on-policy and off-policy learning, online and offline data, model-based planning, multi-agent learning, self-play, hierarchical control, preference learning, and verifiable rewards. Inference engineering begins with one forward pass and reaches continuous batching, KV memory, quantization, parallelism, speculative decoding, disaggregation, autoscaling, SLOs, and fleet economics.
The recurring case: an incident-reasoning engine
The incident-reasoning engine is a tool-using AI assistant for network operations teams. It receives an incident question and alert context, then works with a governed catalog of read-only tools that expose topology and inventory, telemetry, logs, and recent configuration changes.
Its job is to gather discriminating evidence, keep competing hypotheses alive, and decide when the evidence is sufficient. Its output is an evidence-backed likely cause, cited observations, explicit uncertainty, and a recommended next action for the operator. Throughout the series, this same product turns abstract vocabulary into concrete engineering choices: investigation traces become trajectories, tool calls become actions, replayable incidents become environments, rubrics become rewards, and serving constraints become inference-system requirements.
An alert says a western site is dropping packets. Two gateways serve the site, several telemetry streams disagree, and a recently changed interface is an attractive but misleading clue. The engine can inspect topology, query time-series data, search logs, test hypotheses, or answer. This investigation exposes the decision problem that RL must improve and the inference workload that production systems must execute.
Three reading paths
| You need | Route | Do not skip |
|---|---|---|
| A complete mental model | Read chapters 1 through 22 in order. | The concrete reasoning episode and the field guide. |
| RL for agent work | Read 1-11, then 19-22. | Value and advantage before PPO/GRPO; systems before the applied pipeline. |
| Inference depth | Read 1-2, 12-19, then 22. | Prefill/decode before optimization; goodput before benchmark interpretation. |