Model-based RL: learn the world before choosing a route
基于模型的强化学习
Plan with empirical transitions, separate model error from real samples and computation, and expose an uncovered-action trap.
model-based-rlA route is only as useful as its map
Consider a teaching delivery robot. It can take a slow route or try a faster passage that sometimes sends it back to its current position. Direct value learning repeatedly tries actions and adjusts choices from returns. Model-based reinforcement learning also asks: where might this action lead, how likely is each result, and what reward will it produce? Those predictions allow route calculations before the robot moves.
Here a model means a predictor of environmental outcomes, not any machine-learning model. A neural network that outputs actions is a policy; one that outputs action values is a value function. Neither automatically becomes an environment model by using a neural network. An environment model can be a transition-probability table or a program that samples a next state and reward. Distribution and sample models
Separate two jobs: learning a model that approximates the environment, and using it to seek a high-return policy. With exact rules already supplied, the second job is planning without first learning the rules. With estimated rules, even exact planning can solve the wrong problem exactly. We calculate that distinction with finite tables here; the Dyna article puts learning and planning into one online loop.
Separate three kinds of error
Use a Markov decision process with finite states and actions. Write the state as , the action as and the next state as . Rewards are bounded and the discount satisfies . For an expected discounted-return objective, define:
For this expectation objective, the transition distribution and conditional mean reward suffice for Bellman backups. Generating complete random-return trajectories, studying risk or retaining reward–next-state dependence requires the corresponding joint distribution; a reward mean cannot answer every question. A distribution model permits summation over next states, whereas a sample model generates one possible outcome. Their computational costs and estimator variances differ. What a model supplies
Suppose real transitions have been collected, with reaching . An empirical model is:
A zero denominator means unknown, not “this action has zero reward and zero risk.” The program deliberately queries every nonterminal state–action pair, rather than silently filling uncovered actions. Access that samples a specified state and action is called a generative query. A real robot generally collects data along its own trajectory and cannot jump freely to any state.
Given the empirical model, value iteration uses the following operator. A terminal state is represented as a zero-reward absorbing state, so its value is zero:
Each iteration scores all actions and takes the maximum. A probability-weighted average cannot expand the maximum absolute difference between two inputs, nor can the maximum operation. The operator therefore shrinks that distance by at least a factor and has a unique fixed point . Let the residual measure how far the table lies from its own backup. The triangle inequality gives:
This controls numerical solution error for the empirical model. It does not establish that the model is correct or that the real policy is optimal. The program divides the residual by to bound value error; two nearly identical iterates are not treated as validation against reality.
What about model error itself? Fix the same policy and use superscripts for rewards and transition matrices averaged over its actions. Subtract the two Bellman equations, keeping the value difference in a model-transition term on the right:
Suppose reward means differ by at most , transition distributions at every state–action pair have L1 distance at most , and absolute real rewards are bounded by . A geometric series gives . Taking maximum norms term by term and moving the final term to the left yields this article’s independently derived finite-model bound:
This uses L1 distance; a total-variation formulation needs a corresponding change of constants. It compares the same policy in two models and should not simply be renamed the learned policy’s optimality gap. A finite validation set’s average prediction loss also does not automatically supply these uniform bounds over all state–action pairs.
A tractable counterexample gives one point per step. The real system survives with probability 0.99; the model predicts permanent survival. Rewards are zero after exit. With discount 0.99 and the current reward delivered before the survival outcome:
Transition L1 error is only 0.02, yet the value gap is approximately 49.7487. The generic bound above is 198: it covers the gap but is loose. This illustrates repeated use of an error when discount is near 1, not a claim that every one-step error grows at this worst-case rate.
Score the policy in its model and in reality
The following original three-state, two-action example needs only Python 3.12 or later and the standard library. State 2 is terminal. In state 0, action 0 pays 0.05 and reaches state 1 with probability 0.15, otherwise staying put; action 1 costs 0.02 but reaches state 1 with probability 0.9. In state 1, action 0 pays 0.7 and stays with probability 0.2; action 1 pays 1 and terminates. Each reward in this example is deterministic; only the next state is random.
The discount is 0.9. The exact optimal policy selects action 1 in both nonterminal states. State 1 has value 1; state 0 satisfies , giving . This calculation is independent of value iteration and can check the program.
Learning queries each of four nonterminal state–action pairs times, totaling real queries. Planning receives only the empirical model. After policy selection, a two-variable linear solve in the real environment computes its actual value. That real-model evaluation is a teaching diagnostic; a deployed system would generally need separate real evaluation. Feeding these rules into training would invalidate a claim that the real dynamics were unavailable.
"""Original finite-model teaching experiment; Python 3.12+, standard library."""
import json
import math
import random
GAMMA = 0.9
# Rows are (mean reward, next-state probabilities); state 2 is absorbing.
TRUE_MODEL = [
[(0.05, [0.85, 0.15, 0.0]), (-0.02, [0.1, 0.9, 0.0])],
[(0.7, [0.0, 0.2, 0.8]), (1.0, [0.0, 0.0, 1.0])],
[(0.0, [0.0, 0.0, 1.0]), (0.0, [0.0, 0.0, 1.0])],
]
def validate(model, gamma):
if not 0 <= gamma < 1 or not model:
raise ValueError("Require a nonempty model and discount in [0, 1).")
size = len(model)
for actions in model:
if not actions:
raise ValueError("Each state needs an action.")
for reward, probs in actions:
if (not math.isfinite(reward) or len(probs) != size
or any(not math.isfinite(p) or p < 0 for p in probs)
or abs(sum(probs) - 1) > 1e-12):
raise ValueError("Invalid reward or transition distribution.")
def backup(model, values, gamma):
return [[reward + gamma * sum(p * v for p, v in zip(probs, values))
for reward, probs in actions] for actions in model]
def plan(model, gamma=GAMMA, tolerance=1e-10, max_iterations=10000):
validate(model, gamma)
if tolerance <= 0 or not math.isfinite(tolerance) or max_iterations < 1:
raise ValueError("Positive finite tolerance and iteration budget required.")
values = [0.0] * len(model)
for iteration in range(1, max_iterations + 1):
values = [max(row) for row in backup(model, values, gamma)]
q = backup(model, values, gamma)
residual = max(abs(max(row) - v) for row, v in zip(q, values))
if residual <= tolerance * (1 - gamma):
policy = [max(range(len(row)), key=row.__getitem__) for row in q]
return dict(values=values, policy=policy, residual=residual,
iterations=iteration, value_error_bound=residual / (1 - gamma))
raise RuntimeError("Planning did not reach its residual tolerance.")
def fit_model(samples_per_pair, seed):
"""Generative queries to all four nonterminal pairs, not an online trajectory."""
if not isinstance(samples_per_pair, int) or samples_per_pair < 1:
raise ValueError("At least one query per pair is required.")
rng = random.Random(seed)
model = []
counts = []
for state in range(2):
actions, state_counts = [], []
for reward, probs in TRUE_MODEL[state]:
hits = [0, 0, 0]
reward_sum = 0.0
for _ in range(samples_per_pair):
u = rng.random()
cumulative = 0.0
for next_state, probability in enumerate(probs):
cumulative += probability
if u < cumulative:
hits[next_state] += 1
break
reward_sum += reward # deterministic rewards in this task
actions.append((reward_sum / samples_per_pair,
[n / samples_per_pair for n in hits]))
state_counts.append(hits)
model.append(actions)
counts.append(state_counts)
# Termination and the zero-reward absorbing convention are supplied, not learned.
model.append([(0.0, [0.0, 0.0, 1.0]), (0.0, [0.0, 0.0, 1.0])])
return model, counts
def evaluate_two_state(policy, model=TRUE_MODEL, gamma=GAMMA):
"""Independent 2x2 linear solve; terminal value is zero."""
validate(model, gamma)
r0, p0 = model[0][policy[0]]
r1, p1 = model[1][policy[1]]
a, b = 1 - gamma * p0[0], -gamma * p0[1]
c, d = -gamma * p1[0], 1 - gamma * p1[1]
determinant = a * d - b * c
return [(r0 * d - b * r1) / determinant,
(a * r1 - c * r0) / determinant, 0.0]
def experiment():
exact = plan(TRUE_MODEL)
rows = []
for n in (2, 10, 100):
for seed in range(8):
model, counts = fit_model(n, seed)
learned = plan(model)
actual = evaluate_two_state(learned['policy'])[0]
l1 = max(sum(abs(x - y) for x, y in zip(p, phat))
for original, estimated in zip(TRUE_MODEL, model)
for (_, p), (_, phat) in zip(original, estimated))
rows.append(dict(n=n, seed=seed, real_queries=4*n, counts=counts,
policy=learned['policy'], model_value=learned['values'][0],
true_policy_value=actual, regret=exact['values'][0]-actual,
max_transition_l1=l1, planning_iterations=learned['iterations'],
planning_residual=learned['residual']))
return dict(exact=exact, rows=rows)
if __name__ == '__main__':
print(json.dumps(experiment(), indent=2))
Inspect the complete recorded output
{
"exact": {
"values": [
0.8681318681293009,
1.0,
0.0
],
"policy": [
1,
1,
0
],
"residual": 2.336242310718717e-12,
"iterations": 12,
"value_error_bound": 2.3362423107187176e-11
},
"rows": [
{
"n": 2,
"seed": 0,
"real_queries": 8,
"counts": [
[
[
2,
0,
0
],
[
0,
2,
0
]
],
[
[
0,
0,
2
],
[
0,
0,
2
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.88,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.39999999999999997,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 2,
"seed": 1,
"real_queries": 8,
"counts": [
[
[
2,
0,
0
],
[
0,
2,
0
]
],
[
[
0,
0,
2
],
[
0,
0,
2
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.88,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.39999999999999997,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 2,
"seed": 2,
"real_queries": 8,
"counts": [
[
[
0,
2,
0
],
[
2,
0,
0
]
],
[
[
0,
0,
2
],
[
0,
0,
2
]
]
],
"policy": [
0,
1,
0
],
"model_value": 0.9500000000000001,
"true_policy_value": 0.7872340425531915,
"regret": 0.08089782557610936,
"max_transition_l1": 1.8,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 2,
"seed": 3,
"real_queries": 8,
"counts": [
[
[
2,
0,
0
],
[
0,
2,
0
]
],
[
[
0,
1,
1
],
[
0,
0,
2
]
]
],
"policy": [
1,
0,
0
],
"model_value": 1.125454545444855,
"true_policy_value": 0.7378718842133476,
"regret": 0.13025998391595328,
"max_transition_l1": 0.6000000000000001,
"planning_iterations": 32,
"planning_residual": 5.3297366520155265e-12
},
{
"n": 2,
"seed": 4,
"real_queries": 8,
"counts": [
[
[
2,
0,
0
],
[
0,
2,
0
]
],
[
[
0,
1,
1
],
[
0,
0,
2
]
]
],
"policy": [
1,
0,
0
],
"model_value": 1.125454545444855,
"true_policy_value": 0.7378718842133476,
"regret": 0.13025998391595328,
"max_transition_l1": 0.6000000000000001,
"planning_iterations": 32,
"planning_residual": 5.3297366520155265e-12
},
{
"n": 2,
"seed": 5,
"real_queries": 8,
"counts": [
[
[
2,
0,
0
],
[
0,
2,
0
]
],
[
[
0,
0,
2
],
[
0,
0,
2
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.88,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.39999999999999997,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 2,
"seed": 6,
"real_queries": 8,
"counts": [
[
[
2,
0,
0
],
[
0,
2,
0
]
],
[
[
0,
1,
1
],
[
0,
0,
2
]
]
],
"policy": [
1,
0,
0
],
"model_value": 1.125454545444855,
"true_policy_value": 0.7378718842133476,
"regret": 0.13025998391595328,
"max_transition_l1": 0.6000000000000001,
"planning_iterations": 32,
"planning_residual": 5.3297366520155265e-12
},
{
"n": 2,
"seed": 7,
"real_queries": 8,
"counts": [
[
[
2,
0,
0
],
[
1,
1,
0
]
],
[
[
0,
0,
2
],
[
0,
0,
2
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.7818181818051804,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.8,
"planning_iterations": 32,
"planning_residual": 7.150835479308171e-12
},
{
"n": 10,
"seed": 0,
"real_queries": 40,
"counts": [
[
[
10,
0,
0
],
[
0,
10,
0
]
],
[
[
0,
1,
9
],
[
0,
0,
10
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.88,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.30000000000000004,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 10,
"seed": 1,
"real_queries": 40,
"counts": [
[
[
10,
0,
0
],
[
2,
8,
0
]
],
[
[
0,
2,
8
],
[
0,
0,
10
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.853658536579944,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.30000000000000004,
"planning_iterations": 16,
"planning_residual": 4.446110146716364e-12
},
{
"n": 10,
"seed": 2,
"real_queries": 40,
"counts": [
[
[
8,
2,
0
],
[
0,
10,
0
]
],
[
[
0,
3,
7
],
[
0,
0,
10
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.88,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.20000000000000007,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 10,
"seed": 3,
"real_queries": 40,
"counts": [
[
[
10,
0,
0
],
[
0,
10,
0
]
],
[
[
0,
2,
8
],
[
0,
0,
10
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.88,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.30000000000000004,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 10,
"seed": 4,
"real_queries": 40,
"counts": [
[
[
9,
1,
0
],
[
0,
10,
0
]
],
[
[
0,
2,
8
],
[
0,
0,
10
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.88,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.19999999999999998,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 10,
"seed": 5,
"real_queries": 40,
"counts": [
[
[
7,
3,
0
],
[
1,
9,
0
]
],
[
[
0,
4,
6
],
[
0,
0,
10
]
]
],
"policy": [
1,
0,
0
],
"model_value": 0.9515796703233558,
"true_policy_value": 0.7378718842133476,
"regret": 0.13025998391595328,
"max_transition_l1": 0.4000000000000001,
"planning_iterations": 25,
"planning_residual": 4.041544876542957e-12
},
{
"n": 10,
"seed": 6,
"real_queries": 40,
"counts": [
[
[
10,
0,
0
],
[
0,
10,
0
]
],
[
[
0,
3,
7
],
[
0,
0,
10
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.88,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.30000000000000004,
"planning_iterations": 2,
"planning_residual": 0.0
},
{
"n": 10,
"seed": 7,
"real_queries": 40,
"counts": [
[
[
10,
0,
0
],
[
2,
8,
0
]
],
[
[
0,
4,
6
],
[
0,
0,
10
]
]
],
"policy": [
1,
0,
0
],
"model_value": 0.9359756097476781,
"true_policy_value": 0.7378718842133476,
"regret": 0.13025998391595328,
"max_transition_l1": 0.4000000000000001,
"planning_iterations": 25,
"planning_residual": 5.388467450018197e-12
},
{
"n": 100,
"seed": 0,
"real_queries": 400,
"counts": [
[
[
79,
21,
0
],
[
11,
89,
0
]
],
[
[
0,
20,
80
],
[
0,
0,
100
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.866814650381144,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.11999999999999994,
"planning_iterations": 12,
"planning_residual": 6.589173651150304e-12
},
{
"n": 100,
"seed": 1,
"real_queries": 400,
"counts": [
[
[
87,
13,
0
],
[
12,
88,
0
]
],
[
[
0,
20,
80
],
[
0,
0,
100
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.8654708520158838,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.04000000000000001,
"planning_iterations": 13,
"planning_residual": 1.8316459460265833e-12
},
{
"n": 100,
"seed": 2,
"real_queries": 400,
"counts": [
[
[
78,
22,
0
],
[
16,
84,
0
]
],
[
[
0,
20,
80
],
[
0,
0,
100
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.8598130841028792,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.13999999999999996,
"planning_iterations": 14,
"planning_residual": 7.935430090810769e-12
},
{
"n": 100,
"seed": 3,
"real_queries": 400,
"counts": [
[
[
76,
24,
0
],
[
8,
92,
0
]
],
[
[
0,
19,
81
],
[
0,
0,
100
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.8706896551693413,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.17999999999999997,
"planning_iterations": 11,
"planning_residual": 2.8513857941447895e-12
},
{
"n": 100,
"seed": 4,
"real_queries": 400,
"counts": [
[
[
84,
16,
0
],
[
15,
85,
0
]
],
[
[
0,
23,
77
],
[
0,
0,
100
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.8612716762965646,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.10000000000000003,
"planning_iterations": 14,
"planning_residual": 3.471556375700402e-12
},
{
"n": 100,
"seed": 5,
"real_queries": 400,
"counts": [
[
[
79,
21,
0
],
[
5,
95,
0
]
],
[
[
0,
18,
82
],
[
0,
0,
100
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.874345549737596,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.11999999999999994,
"planning_iterations": 10,
"planning_residual": 5.95745675013859e-13
},
{
"n": 100,
"seed": 6,
"real_queries": 400,
"counts": [
[
[
88,
12,
0
],
[
12,
88,
0
]
],
[
[
0,
24,
76
],
[
0,
0,
100
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.8654708520158838,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.08000000000000002,
"planning_iterations": 13,
"planning_residual": 1.8316459460265833e-12
},
{
"n": 100,
"seed": 7,
"real_queries": 400,
"counts": [
[
[
87,
13,
0
],
[
12,
88,
0
]
],
[
[
0,
18,
82
],
[
0,
0,
100
]
]
],
"policy": [
1,
1,
0
],
"model_value": 0.8654708520158838,
"true_policy_value": 0.8681318681318682,
"regret": -2.567279722143212e-12,
"max_transition_l1": 0.04000000000000001,
"planning_iterations": 13,
"planning_residual": 1.8316459460265833e-12
}
]
}All results for seeds 0–7 are retained. Four seeds select a wrong policy at , two at , and all eight select this task’s optimal policy at . Mean absolute differences between predicted start value and that policy’s real value are approximately 0.180929, 0.060703 and 0.004156. Tiny negative regret entries in the complete output come from numerical stopping error, around ; they do not mean a policy beat the real optimum.
These results use 8, 40 and 400 generative queries, not that many complete episodes. More samples did not produce monotonic improvement for every seed, and success on eight seeds is not a universal sample-size guarantee. Planning iterations are recorded separately because fewer real samples need not mean less computation time.
For a general dense table with states and actions per state, storing transitions costs space. One full expectation-backup sweep costs operations, or for sweeps. Sparse transitions can visit only nonzero entries. This program’s sampler scans up to outcomes; with samples per pair, sampling computation is while real query count remains . Those are different units.
A model can mistake its blind spots for opportunities
Consider a second, two-action counterexample. Real rewards are 0.5 and 0, but the data contain only action 0. A model correctly predicts its 0.5 reward while assigning an optimistic prediction of 1 to unseen action 1. Observed mean squared error is zero, yet planning chooses the action whose real reward is zero. That optimistic value is an explicit assumption here, not a data-supported estimate. Policy optimization seeks the places the model rates highest, which can lie far from the data.
MBPO studies model error and policy-distribution change, using short model branches from real replay states to limit long prediction chains. The task horizon can be long while model branches stay short. Restarting prediction from a recorded real state does not require terminating the task early. The method uses probabilistic model ensembles and SAC learning from generated experience; our table program does not implement MBPO. Model use and short branches
Agreement among ensemble members is not proof of reliable prediction: they may share a bias. The paper’s conditional return bounds depend on particular error quantities and assumptions. An ordinary validation loss cannot simply replace those quantities to promise improvement from neural model training. Theoretical and practical conditions
Model scope matters too. If observations are not Markov states, prediction may need history or latent state. When the environment changes, old data may describe passages that no longer exist. Before choosing a method, compare a value-learning baseline using only real data. Ask whether the model covers the regions the policy will visit and whether saved interactions justify fitting and planning costs.
Predict before checking the answer
-
Understanding: The empirical-model residual is and discount is 0.9. What error bound follows? Does it establish the same accuracy in reality?
Answer: Optimal-value error for that empirical model is at most . This controls numerical solution error only. An incorrect model can still give incorrect real values or a suboptimal real policy.
-
Calculation: Change the survival example’s discount to 0.5, keeping everything else fixed. What are the real and model values?
Answer: Real value is and model value is 2, a gap of . Giving the future less weight makes the same transition bias much less consequential in this example.
-
Counterexample: Why does the two-action example select wrongly despite zero observed error? Can additional simulation supply the missing information?
Answer: Error is measured only on the observed action, leaving the optimistic unseen-action prediction untested. More simulation reuses that assumption. Real coverage, justified constraints or evaluation of unknown regions is needed; repeated generation is not a new observation.
-
Transfer: A table task queries each pair 10 times before selecting a policy. Your online robot cannot start from arbitrary states. Can you directly claim it needs only 40 real actions?
Answer: No. Forty counts samples for four state–action pairs under a generative-query interface. Online access also costs state-reaching actions, exploration and possible resets, with uneven coverage. Redesign and evaluate under a real-trajectory budget.
From planning models to learned models
Sutton and Barto’s second-edition working draft distinguishes distribution models, sample models and planning through model-generated experience. The version actually read here is the copyright 2014/2015 draft, physical PDF pages 209–220, not the final 2018 edition. Reading scope and version are retained together. Textbook working draft
Janner and colleagues’ MBPO paper (NeurIPS 2019) advances the question of how long a model should be used. This article draws on conference PDF pages 2–6 and the identity/abstract portion of page 1, with pages 4 and 6 visually inspected. It does not claim a full appendix-proof audit or control-benchmark replication. The finite table, error derivation and counterexamples above are original teaching calculations. MBPO paper
Continue to Dyna for a real transition serving both model and value learning. World models and MuZero extend the questions about prediction targets, representations and planning interfaces.
Make a prediction, then check
What does a near-zero Bellman residual in an empirical model establish?
Learning objectives
- Build a finite model from transition counts and mean rewards; use a Bellman residual to assess planning.
- Separate numerical error, model error and real policy return, and explain short model branches.
Prerequisites & connections
Explore related knowledge →References
- Reinforcement Learning: An Introduction — second-edition working draft, chapter 8
Richard S. Sutton; Andrew G. Barto · 2015 - When to Trust Your Model: Model-Based Policy Optimization — scoped methods
Michael Janner; Justin Fu; Marvin Zhang; Sergey Levine · 2019
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Codex · 2026-09-23 · Single AI author. Scoped reading: Copyright2014/2015 working draft, not the final2018 edition. Read physical PDF209–220, viewed215: models, Dyna, changing environments and Dyna-Q+ footnote. Later prioritized-sweeping algorithm not audited; PDF hash and scope retained in research records. NeurIPS32; read first1800 characters of PDF1 and all text of2–6, viewed4/6. Model error, policy shift, short branches from real states and probabilistic ensembles; no complete appendix/benchmark audit or transcription of ambiguous PDF5 formulas. 7 paired equations and four explained exercises. Finite empirical counts, Bellman residual bound, fixed-policy L1 perturbation bound and uncovered-action counterexample checked. Independent 2x2 solves evaluate all four policies; all24 generative-query settings retained. Exact real model is evaluation-only after planning. No MBPO benchmark reproduction or uniform finite-sample guarantee.
- Finite empirical counts, Bellman residual bound, fixed-policy L1 perturbation bound and uncovered-action counterexample checked. Independent 2x2 solves evaluate all four policies; all24 generative-query settings retained. Exact real model is evaluation-only after planning. No MBPO benchmark reproduction or uniform finite-sample guarantee.
- Four computed SVG variants per topic;9 numeric/geometry tests and12 current responsive cases passed. All six selected current captures directly viewed; revised English titles resolve the retained initial clipping failure. Actual assets and manuscripts are SHA bound. Full article acceptance recorded separately.
Source locations checked:
- Reinforcement Learning: An Introduction — second-edition working draft, chapter 8 · Copyright2014/2015 working draft, not the final2018 edition. Read physical PDF209–220, viewed215: models, Dyna, changing environments and Dyna-Q+ footnote. Later prioritized-sweeping algorithm not audited; PDF hash and scope retained in research records.
- When to Trust Your Model: Model-Based Policy Optimization — scoped methods · NeurIPS32; read first1800 characters of PDF1 and all text of2–6, viewed4/6. Model error, policy shift, short branches from real states and probabilistic ensembles; no complete appendix/benchmark audit or transcription of ambiguous PDF5 formulas.
Related topics