Outcome and Process Reward Models › Worked Example
Language AI HandbookAll chapters A ten-node graph gives us enough structure to check illegal shortcuts, legal dead ends, and the scores assigned by different reductions by hand.
The domain is a ten-node directed graph. A state is a node. A step moves from a node to a successor. The start is node 0 and the goal is node 9. A trajectory is a sequence from the start, which can contain illegal transitions; its answer is the node it ends on. The answer is correct if and only if the final node is 9.
0 -> 1, 2
1 -> 3, 4
2 -> 5, 6
3 -> 7
4 -> (none)
5 -> (none)
6 -> 8
7 -> 9
8 -> 9
9 -> (none)
Nodes 4 and 5 are dead ends: once you arrive, no legal move exists and the answer is wrong. Every other non-goal node can still reach 9.
Nodes 1 and 2 each have one successor on a route to the goal and one non-goal dead end. With enough steps left, a policy taking legal successors uniformly at random succeeds from node 1 with probability 1/2, even though node 1 can reach the goal.
We compute two step properties exactly. For a step from to :
- Locally valid: is a successor of in the graph.
- Reachable target means that a legal path from to 9 exists. Node 9 qualifies by the zero-length path.
For the toy model, a good step is a legal edge whose target can reach the goal. We compute both properties directly from the graph. A rollout-based label would estimate success under a specified continuation policy.
Now consider three candidates.
| Candidate | Path | Answer | Outcome | Step labels (valid / reachable / good) |
|---|---|---|---|---|
| A | 0 → 1 → 3 → 7 → 9 | 9, correct | 1 | (1,1,1), (1,1,1), (1,1,1), (1,1,1) |
| B | 0 → 1 → 4 | 4, wrong | 0 | (1,1,1), (1,0,0) |
| C | 0 → 1 → 4 → 9 | 9, correct by luck | 1 | (1,1,1), (1,0,0), (0,1,0) |
Candidate B’s second step is legal, but node 4 has no route to the goal. Candidate C’s final jump is illegal, yet it lands on the goal. The reachability label is 0 for B’s final step and 1 for C’s.
A reaches the goal through legal edges. B takes legal edges to a dead end. C reaches the goal by taking an illegal final edge.
Read each row of the grid as one step in one candidate path. The columns give edge validity, target reachability, and the conjunction of the two. All three labels come directly from the graph.
PythonIn [6]Expand
import numpy as np
candidate_step_rows = [
("A1", 1, 1, 1),
("A2", 1, 1, 1),
("A3", 1, 1, 1),
("A4", 1, 1, 1),
("B1", 1, 1, 1),
("B2", 1, 0, 0),
("C1", 1, 1, 1),
("C2", 1, 0, 0),
("C3", 0, 1, 0),
]
step_label_matrix = np.array(
[[v, s, g] for _, v, s, g in candidate_step_rows], dtype=float
)
step_label_ticklabels = [name for name, _, _, _ in candidate_step_rows]VisualizationOut [7]Expand

Suppose the step grader is decent but not perfect: it assigns 0.90 to a good step and 0.10 to a bad one. Then:
| Candidate | Verifier | Product | Min | Last |
|---|---|---|---|---|
| A | 1 | 0.9⁴ = 0.656 | 0.90 | 0.90 |
| B | 0 | 0.9 × 0.1 = 0.090 | 0.10 | 0.10 |
| C | 1 | 0.9 × 0.1 × 0.1 = 0.009 | 0.10 | 0.10 |
Read the columns. The verifier ties A and C at 1. It cannot see that C's last step is illegal. If you use the verifier as a training reward, you treat a hallucinated jump and a valid proof as equally good. If you use it for reranking, you are indifferent between them and will pick one arbitrarily.
The product ranks A above B and B above C under the stated step scores. Adding another 0.10 factor lowers C’s score despite its correct terminal result.
The minimum and last tie B and C at 0.10. For each of these aggregations, the one score it retains is identical across the two candidates.
The length effect also appears in a hypothetical eight-step candidate whose steps all score 0.90. Its product is , below the four-step score of 0.656. Both get 0.90 under the minimum and the last-step score. The toy graph has no legal eight-step route to the goal.
The outcome checker ties A and C, while all three step-score aggregations rank A first. The product also distinguishes B from C.
Product lowers C’s score for the additional 0.10 factor. Minimum and last both keep 0.10 for B and C. Choose based on whether the additional low score should affect the ranking.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!