LinTree: Improving LLM Reasoning with Explicitly Structured Search Histories

Liwei Kang, Yee Whye Teh, Wee Sun LeearXiv 2026

TL;DR

When Large Language Models (LLMs) solve complex problems, they often backtrack and try alternative paths, implicitly building a search tree in their context window. This paper demonstrates that flat text histories make it difficult for LLMs to track their progress, but adding simple "parent pointers" to explicitly map out the tree structure (LinTree) dramatically boosts both reasoning accuracy and search efficiency.

What Problem Does This Paper Address?

Techniques like Chain-of-Thought (CoT) prompting and self-reflection allow LLMs to explore multiple reasoning paths, correct mistakes, and backtrack. From a computer science perspective, this trial-and-error process is essentially a tree search.

Intuitively, an LLM should have a massive advantage over traditional search algorithms because it can condition its next step on the entire history of its search trace, rather than just evaluating the current local state. However, the authors discover a surprising bottleneck: raw access to a flat text history doesn't reliably beat a simple local heuristic search baseline.

The core issue is that flat text serializations leave the underlying tree topology implicit. When an LLM decides to abandon a failed line of thought and try a different approach, the text trace rarely clarifies which exact previous state it is returning to. The model is forced to waste capacity inferring the structure of its own history.

Methods

To solve this, the authors introduce LinTree, a minimal modification to the trace representation that makes the tree topology explicit.

Instead of a standard implicit format: EXPAND ACT {action} -> {resulting state}

LinTree introduces state identifiers (sid) and parent pointers: EXPAND sid=0 ACT {action} -> sid=1 {resulting state}

The authors train and evaluate these models using a robust two-stage pipeline:

  1. Supervised Fine-Tuning (SFT): Training the LLM (using Qwen3-0.6B as a backbone) on valid search traces generated by a rule-based heuristic search.
  2. Reinforcement Learning (RL): Optimizing the policy using Group Relative Policy Optimization (GRPO). Crucially, the reward function penalizes longer search traces, forcing the model to optimize for both correctness and search efficiency.

They compare LinTree against both implicit trace models and a local-state LLM heuristic baseline—a best-first search (BFS) algorithm where the LLM only scores the immediate frontier nodes without seeing the history.

Datasets

The approach is evaluated across three controlled reasoning environments where search trees are well-defined and efficiency can be precisely measured:

  • Blocks World: A classic planning problem involving rearranging stacks of blocks.
  • Grid Navigation: Moving an agent through a $10 \times 10$ grid filled with random obstacles.
  • Sokoban: A notoriously challenging puzzle game where an agent pushes boxes onto target locations.

For each domain, the authors generate 20k instances for SFT training, 20k for RL training, and 1k for validation.

Key Insights and Ideas

  • Structure Trumps Raw Context: Simply stuffing the history into the prompt isn't enough. The LLM needs explicit structural markers (like parent pointers) to effectively utilize its past attempts and avoid getting lost in its own context window.
  • Plan Extraction is a Major Bottleneck: A significant portion of failures in implicit models occurs because the model successfully finds the goal during its search but fails to cleanly extract the final winning sequence of actions from its messy history. LinTree's explicit structure drastically reduces these plan-extraction failures.
  • More Effective Exploration: By explicitly tracking the tree, the trace-conditioned LLM learns to steer clear of neighborhoods it has already explored. Analysis showed that LinTree models maintain a higher average pairwise distance between visited states, indicating broader and more efficient exploration than local heuristics.

Key Results

The experimental results highlight a clear victory for explicit structuring:

Table 2: Policies with versus without access to the search trace, evaluated on the three reasoning domains. Lower is better for expansions. Subscripts show standard errors.
  • Implicit Models Struggle: As shown in Table 2, the GRPO-implicit model frequently underperformed compared to the local-state BFS (RL) baseline in terms of success rate, despite having access to the full history.
  • LinTree Dominates: Once parent pointers were introduced (GRPO-explicit), the model achieved a 100% success rate in both Blocks World and Grid Navigation, while simultaneously reducing the number of required search expansions.
  • Sokoban Efficiency: In the highly complex Sokoban domain, when paired with a generation constraint to prevent invalid moves, the explicit LinTree model matched the high success rate of the local baseline (98.9% vs 99.1%) but did so using significantly fewer expansions (54.70 vs 64.08).

Limitations and Future Work

While promising, the authors note a few key limitations:

  • Controlled Domains: The experiments were restricted to three fully observable, simulated planning tasks with discrete state spaces.
  • Scale: The findings were demonstrated on a single, relatively small base LLM (0.6B parameters).

Future Directions: The most exciting next step is figuring out how to translate these structured search histories into open-ended, natural language reasoning tasks (like complex math or coding problems) where "states" and "transitions" are not as cleanly defined.

Summary updated

BibTeX
@misc{kang2026lintree,
  author = {Liwei Kang and Yee Whye Teh and Wee Sun Lee},
  title = {{LinTree: Improving LLM Reasoning with Explicitly Structured Search Histories}},
  year = {2026},
  eprint = {2605.31492},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.31492},
}
Figure