Represent partial states, expand and rank alternatives, trace beam pruning, and distinguish heuristic search from verified success.
Preparation: arithmetic, lists and the test-time compute lesson.
Plan 25–40 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.
FULL LOCAL NARRATION
Follow the complete explanation.
Narration includes worked solutions. Pause at each practice prompt before continuing. Formula notation has a spoken explanation; all teaching text remains readable.
High-school path. Represent partial states, expand and rank alternatives, trace beam pruning, and distinguish heuristic search from verified success. Preparation: arithmetic, lists and the test-time compute lesson. Move between Signal Room, Workbench and Field Notes without losing your section. Pause before each worked solution.
A single generated solution commits to one sequence of intermediate decisions. Tree-of-thought search organizes several partial solutions as states, proposes continuations, evaluates them and decides which to explore. The “thought” is a chosen unit of progress, not a literal inspection of a model’s mind. It might be an equation, a paragraph or a planning step. The original framework uses language models within this search process. Our experiment replaces model calls with simple arithmetic actions so you can inspect exactly why a branch survives or disappears.
Worked example. Start at one. At each step you may add two or multiply by two. The goal is to reach ten within three actions. The first action creates states three and two. Instead of choosing immediately, a search procedure can keep both as possibilities.
State → candidate steps → evaluation → retained frontier
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. What additional component does a search system need beyond a generator of candidate steps?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
It needs a policy for evaluating, retaining and exploring states, plus a way to recognize a valid final solution. Generation alone does not decide which paths deserve the remaining budget.
Section 02 / 07
Choose a state representation that preserves the problem
A search state must contain enough information to determine valid next steps and whether the goal is satisfied. In our arithmetic task, the current number and the path that produced it are sufficient because the same two actions are always available. In other tasks, remaining resources, previous commitments or constraints may matter. If you discard that information, two apparently similar states may not be interchangeable. Keep an explicit path so a claimed result can be replayed from the start rather than trusted because a score is high.
Worked example. The value four can be reached from two by adding two or multiplying by two. At the same depth, either route leaves the same future numeric possibilities in this task. Retaining one path avoids duplicate work while preserving reachability from that state.
Merge states only when their future legal continuations are equivalent
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Would equal current totals always justify merging two states in a shopping-plan problem?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. The plans may have bought different items or used different coupons. Future options can depend on that history. A sufficient state must retain every constraint relevant to later decisions.
Section 03 / 07
A heuristic is a prediction, not the goal test
Our heuristic prefers states with smaller absolute distance from the target. This is easy to calculate and often feels sensible, but it does not predict how many legal actions are needed. Multiplication can make a temporarily less-close state more useful. The goal test is different: the current number must equal the target exactly, and every recorded action must be valid. Keep these roles separate. A high heuristic score can justify exploration; it cannot certify success. The experiment shows both the ranked frontier and the final verified result.
Worked example. From state three, the two next values are five and six. Six is closer to ten, but five reaches ten with one multiplication. From six, one more action gives eight or twelve, neither of which is ten. The closer-looking state can therefore lose the only solution within the depth cap.
Heuristic h(x)=|target−x|; goal test: x=target
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Why should distance-to-target not be described as a proof that one branch is better?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
It is a heuristic estimate under this action system. Future legal transitions matter. A branch can look worse numerically and still contain a valid short solution.
Section 04 / 07
Watch a narrow beam discard the useful path
Beam width limits how many states survive each depth. Width one behaves like a greedy choice among that layer’s candidates. For our default problem, it keeps three after the first step and six after the second, discarding five. It then fails to reach ten within the third step. Width two keeps both five and six at the second layer and finds the goal from five. The difference is visible in the trace. More breadth can protect a promising alternative, but it also increases the work required to generate and evaluate states.
Worked example. With width one and depth three, the retained values progress from one to three to six, then a non-goal frontier. With width two, the second frontier contains six and five. Expanding five generates seven and ten, and the goal is found.
Frontier_next = best B distinct generated states under the heuristic
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Which state was wrongly discarded by the narrow beam in the default example?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
Five. It is slightly farther from ten than six is, but doubling five reaches the goal within the remaining action. The heuristic failed to capture that transition.
Section 05 / 07
Count the work as well as the solution
Every expanded state produces two candidate actions in this fixture. We count expansions and generated candidates separately from retained states. At a layer with beam width B, at most B states are expanded, but duplicate merging and early goal detection can reduce future work. A complete binary tree grows rapidly with depth if nothing is pruned. These counts help explain why real language-model search can be expensive: proposing and evaluating a state may each require model calls, long contexts or tools. Our arithmetic operation counts are not measured model latency.
Worked example. A complete binary tree through depth three has one plus two plus four plus eight, or 15 nodes including the root. The beam retains only a small frontier at each layer. Compare expansion counts in the Workbench while changing width and depth rather than assuming the same cost for every successful run.
Full binary tree nodes through D = 2^(D+1)−1
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Why are generated candidates and retained states different quantities?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
The search can generate several children, merge duplicate states and discard low-ranked candidates. Retention measures what remains available for the next layer; generation measures work already spent.
Section 06 / 07
Backtracking and verification solve different problems
A depth-first strategy can follow one branch and return to earlier alternatives when it fails. That is backtracking. Our beam demonstration does not backtrack; it retains a bounded set of states and permanently prunes the rest. Neither strategy removes the need for verification. Replaying a found action sequence confirms that it obeys the rules and reaches the target. For open-ended language tasks, verification may be less exact, and a search can exploit errors in its evaluator. Better traversal cannot compensate for every flaw in the problem representation or checker.
Worked example. The valid path one, three, five, ten corresponds to add two, add two, multiply by two. Replaying these actions verifies the solution. If a width-one run fails at depth three, that says only that this run failed; the verified path proves the problem itself was solvable.
Search failure under pruning ≠ proof of impossibility
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Does failure of a pruned search prove that no solution exists within the depth limit?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. It may have discarded a useful state. Only an appropriate exhaustive or otherwise complete method can support that stronger claim for the defined search space and bound.
Section 07 / 07
Connect language proposals to a trustworthy search system
In a language-model application, define the thought unit, state format, proposal procedure, evaluator and stopping rule before measuring success. Check that candidate steps preserve constraints. Compare with simpler baselines at matched budgets. Search is valuable when keeping alternatives and checking them improves the final result enough to justify the cost. It is not a new Transformer layer or a guarantee of deliberate human-like thought. The next lesson examines process reward models, which can provide learned scores for intermediate steps but also introduce their own errors.
Worked example. For a planning assistant, test whether each partial plan respects time and resource constraints, whether the final plan is feasible, and how many proposals were evaluated. A fluent intermediate plan with an impossible schedule should not survive merely because it receives a high learned score.
Search quality depends on proposals, evaluation, traversal, budget and verification
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. What should a search log retain so a failure can be diagnosed?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
Retain states, proposed actions, evaluator scores, pruning decisions, budget use and the final checker result. These distinguish a missing candidate from a bad ranking or an inadequate verifier.
Final checkpoint. Why does width one fail in the default depth-three search? Option 1: It discards state five in favor of six. Option 2: Ten is unreachable. Option 3: Multiplication is forbidden.
Pause and choose an answer before continuing.
Reveal worked solution
Option 1 is correct. Five reaches ten in one action, while six cannot. The distance heuristic misses this.
WORKBENCH / PREDICT → TEST → EXPLAIN
Inspect exact numerical data
These are computed teaching fixtures. No remote AI model or GPU is called by the experiment.
CHECK YOUR UNDERSTANDING
Commit to an explanation.
Keep your learning record.
LONGER RETRIEVAL, TOOL AND AGENT LESSONS
Find evidence, use tools and coordinate work
Worked examples, local narration and connected experiments at your level.
Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.