Structured Search for LLM Reasoning
Key Finding
LLMs solve reasoning problems by generating intermediate traces that explore and revise partial solutions. These traces are linearized search trees — the model extends a partial solution, abandons it when stuck, and backtracks to try alternatives.
Critical insight: Raw access to search history alone is NOT enough to outperform heuristic search. The underlying search tree must be explicitly represented with parent pointers (LinTree structure) for the history to become useful.
Methodology
LinTree: Explicit Parent Pointers
When LLM backtracks or switches branches, the trace must explicitly identify which earlier search state is being revisited. Add simple parent pointer annotations:
[Node 1] Initial state → [Node 2] Apply operator A → [Node 3] Dead end
[Node 4] ←back to [Node 1] → Apply operator B → [Node 5] Progress
vs. implicit:
Step 1: Try A → stuck
Step 2: Try something else → still stuck
Step 3: Let me try B → working!
The explicit version preserves the tree structure; the implicit version loses which state is being revisited.
Comparison Framework
| Approach | State Observation | Performance | Search Efficiency |
|---|---|---|---|
| Implicit trace conditioning | Full trace | Baseline | Baseline |
| LLM heuristic (local state only) | Current state only | Competitive | Moderate |
| LinTree (explicit structure) | Trace + parent pointers | Best | Best |
Tested Domains
- Blocks World: Spatial reasoning with block stacking
- Grid Navigation: Pathfinding in grid environments
- Sokoban: Push-box puzzle solving
LinTree improves both task performance and search efficiency across all three.
Design Patterns
Pattern 1: Structured Trace Format
N{id}: [state description] → parent=N{parent_id} → action: {action}
Each reasoning step carries its parent node ID, making the tree structure machine-readable.
Pattern 2: Backtracking with Explicit References
Instead of vague "let me try a different approach," use:
← back to N3, try alternative: {new action}
This preserves the search tree structure and avoids re-exploring dead branches.
Pattern 3: Best-First Selection with Structural Awareness
When selecting next node to expand:
- Parse existing trace to reconstruct tree
- Score each leaf node using LLM heuristic
- Select highest-scoring leaf for expansion
- Generate child node with explicit parent reference
Pitfalls
- Implicit backtracking is the main weakness: Without explicit parent pointers, LLMs lose track of which earlier state they're revisiting, degrading to random exploration
- Trace length limits: Long reasoning traces may exceed context window. LinTree structure helps by enabling pruning of dead subtrees
- Heuristic vs. structural trade-off: Pure heuristic search (local state only) competes with trace-conditioned reasoning. The combination (structure + history) is what wins
- Parsing overhead: Explicit structure requires the model to maintain and reference node IDs — adds token overhead but improves accuracy enough to justify it
Related Skills
confidence-dynamics-early-stop— Early stopping in reasoning chainsagentic-fast-slow-planning— Bridging reasoning with real-time control
