Introduction
Large Language Models (LLMs) have demonstrated impressive instruction-following capabilities, yet they frequently struggle with complex, multi-step reasoning tasks. This is particularly evident when the scale of a problem exceeds the examples seen during training—a phenomenon known as the "compositional gap." While techniques like Chain-of-Thought (CoT) prompting provide a linear path for reasoning, they often falter as the sequence length grows, leading to accumulated errors.
In the paper "Tree of Problems: Improving structured problem solving with compositionality," researchers from Inria introduce Tree of Problems (ToP). This framework shifts away from linear chains and complex search-based graphs toward a recursive, hierarchical approach. By decomposing a single difficult task into a tree of simpler, analogous sub-problems, ToP enables LLMs to solve large-scale problems with high reliability and efficiency.
The Challenge of Compositional Generalization
The primary hurdle addressed by ToP is compositional generalization. For instance, an LLM might successfully concatenate the last letters of four names but fail when the list grows to sixteen. Existing advanced prompting strategies like Tree of Thoughts (ToT) or Graph of Thoughts (GoT) treat reasoning as a search process, which introduces significant overhead and requires complex scoring mechanisms. The authors argue that for many structured problems, such complexity is unnecessary if the problem's inherent recursive structure is leveraged.
The Tree of Problems Framework
ToP transforms a complex problem into a hierarchy of manageable "atomic" instances using three core components:
- The Decomposer: This module breaks the main instance into smaller sub-instances. It can be implemented as a deterministic algorithm or a few-shot prompted LLM. The decomposition is defined by two parameters: breadth ($b$, children per node) and depth ($d$, levels of hierarchy).
- The Solver: This component addresses the "leaf" nodes—the simplest versions of the problem. Because these sub-problems are small, standard CoT prompting is highly effective.
- The Merger: This recursively combines the solutions from child nodes to form the solution for the parent node.
The framework is versatile enough to handle two distinct task types:
- Canonical Tasks: These involve independent sub-problems (e.g., sorting segments of a list) that can be processed in parallel.
- Sequential Tasks: These occur when a step depends on the previous state (e.g., tracking an object's movement). ToP manages this by creating a deep hierarchy (breadth = 1) where each node takes the output of its child as input.
Results and Performance
The researchers evaluated ToP across several benchmarks, including symbolic reasoning (Last Letter Concatenation), BIG-Bench Hard (BBH) tasks, and tasks previously used to evaluate Graph of Thoughts (GoT).
Key quantitative findings include:
- Sorting: On a list of 32 numbers, ToP achieved 68% accuracy, compared to 28% for GoT and near-zero for standard CoT.
- Last Letter Concatenation: For lists of 16 names, ToP reached 44.4% accuracy, nearly doubling the 25.2% achieved by CoT.
- Scaling and Robustness: ToP's benefits scaled with model size. For the Object Counting task, LLaMA 2 70B reached 98% accuracy with ToP. In sequential tasks like Coin Flip, ToP maintained 75.6% accuracy while CoT performance degraded as complexity increased.
Key Insights
The success of ToP stems from several factors:
- The Power of Analogy: Many complex problems are simply larger versions of simpler ones. By solving small versions reliably, ToP avoids the "long-context" failures common in linear reasoning.
- Efficiency: Unlike linear CoT, ToP allows for parallel processing of independent sub-problems, reducing total inference time in production.
- Simplicity over Search: For structured tasks, a fixed tree structure often outperforms expensive heuristic searches used in ToT or GoT.
Discussion and Future Directions
While ToP is highly effective for structured reasoning, it is not a universal solution. Its primary requirement is that a problem must be decomposable into analogous sub-problems, making it less suitable for creative or unstructured tasks.
The authors also noted the "Bad Merger" problem, where sub-problems are solved correctly but the final combination fails. Future work will focus on developing more robust merge prompts and investigating why LLMs occasionally perform worse on very simple sub-tasks than on larger ones. Ultimately, Tree of Problems provides a clear path forward for building reliable reasoning systems by focusing on compositionality rather than just increasing chain length.
Summary updated