Chopping Trees: Semantic Similarity Based Dynamic Pruning for Tree-of-Thought Reasoning

Joongho Kim, Xirui Huang, Zarreen Reza, Gabriel Grand, Kevin Zhu, Ryan Lagasse

TL;DR

This paper introduces Semantic Similarity-Based Dynamic Pruning (SSDP), a novel method to make Tree-of-Thought (ToT) reasoning in Large Language Models (LLMs) more efficient. SSDP prunes redundant reasoning paths in real-time by merging semantically similar branches, achieving significant speedups (up to 2.3x) without sacrificing accuracy.

What Problem Does This Paper Address?

Large Language Models (LLMs) have shown impressive capabilities in complex reasoning tasks by employing Tree-of-Thought (ToT) strategies. Unlike linear Chain-of-Thought (CoT), ToT allows LLMs to explore multiple reasoning paths, enabling backtracking and strategic lookahead. However, this exploration comes at a significant computational cost. The core problem is that many of these explored branches are semantically redundant, meaning they are essentially exploring the same reasoning steps or equivalent paths. This redundancy leads to wasted computation and slower inference times, hindering the scalability and practical application of ToT reasoning.

Methods

The paper introduces Semantic Similarity-Based Dynamic Pruning (SSDP), a lightweight method that integrates online semantic merging into parallelized tree search. SSDP builds upon existing frameworks like Dynamic Parallel Tree Search (DPTS) and incorporates a novel semantic merging module.

The core of SSDP's methodology involves:

  1. Tree Search Framework: It follows a standard Monte Carlo Tree Search (MCTS) loop: selection of promising nodes, expansion to generate children, evaluation of these children, semantic merging and pruning, and backpropagation of scores.
  2. Semantic Merging Module: This is the key innovation. At each expansion step, after generating child nodes and scoring them with a reward model, SSDP performs:
  3. Embedding Generation: Each child node's text is converted into a dense vector embedding using a frozen sentence-transformer.
  4. Similarity-Based Clustering: Sibling nodes whose embeddings have a cosine similarity above a predefined threshold ($\tau$) are grouped into clusters of semantically equivalent nodes.
  5. Representative Selection: From each cluster, only the node with the highest reward score is retained as a representative. All other nodes in the cluster are discarded, and their associated KV caches are freed, immediately reducing memory overhead and computational load.
  6. Pruning: The discarded nodes represent the pruned redundant reasoning paths. This aggressive, online pruning strategy is the primary mechanism for reducing explored nodes and accelerating inference.

SSDP is designed to be lightweight, requiring only a reward model and its core semantic merging logic, without needing dataset-specific fine-tuning.

Datasets

The paper evaluates SSDP on two standard multi-step reasoning benchmarks:

  • GSM8K: A dataset of grade school math problems.
  • MATH500: A dataset of more complex mathematical problems.

These datasets have established scoring procedures, allowing for direct comparison with prior work.

Key Insights and Ideas

  • Semantic Redundancy is a Major Bottleneck: The paper strongly suggests that a significant portion of the computational cost in ToT reasoning comes from exploring semantically identical or highly similar reasoning paths.
  • Online Merging is Key: Integrating semantic merging during the search process (online) is crucial for efficiency. Merging after the fact would not reduce the initial computational cost.
  • Lightweight Approach, Big Gains: SSDP achieves substantial speedups and node reduction with a relatively simple mechanism, demonstrating that sophisticated pruning strategies can be effective without requiring complex model fine-tuning.
  • Trade-off Between Speed and Accuracy: The similarity threshold ($\tau$) offers a tunable knob to balance inference speed and final answer accuracy, allowing users to prioritize one over the other.

Key Results

SSDP demonstrates significant improvements across multiple LLM families (Llama and Qwen) and benchmarks:

  • Speedup: Achieves up to a 2.3x speedup over the state-of-the-art DPTS baseline. When compared to other baselines like Best-of-N, Beam Search, and MCTS, the speedups are even more substantial, ranging from 5.2x to 7.7x.
  • Node Reduction: Dramatically reduces the number of explored nodes by an average of 85-90%.
  • Accuracy: Maintains competitive accuracy, typically within 5% of the strongest baselines, showing no systematic degradation.
  • Model Family Differences: Speedups are slightly larger for the Llama family compared to Qwen, suggesting that models with higher per-token generation costs might benefit more from avoiding redundant computations.

Limitations and Future Work

The authors acknowledge several limitations:

  • Domain Specificity: The current evaluation is concentrated on math reasoning. Generalization to other domains (e.g., code generation, QA, commonsense reasoning) and across different model sizes/families requires further study. Domain-specific similarity encoders might be necessary.
  • Hand-Tuned Threshold: The similarity threshold ($\tau$) is manually tuned and can be dataset- and model-dependent. Further research could explore adaptive or learned thresholds.
  • Potential Over-Pruning: There's a risk of pruning distinct reasoning paths that might appear semantically similar but lead to different, correct derivations. The extent of accuracy loss due to this is not fully quantified.
  • Embedding Backbone Cost: The approach inherits the computational cost and biases of the embedding model. Encoder latency and domain mismatches can affect performance.

Future work could involve domain-specific similarity encoders, adaptive thresholding, and more robust methods to mitigate over-pruning. The paper suggests that targeting semantic redundancy is a highly effective strategy for optimizing LLM reasoning, paving the way for more scalable and practical AI applications.

Summary updated

BibTeX
@inproceedings{kim2025chopping,
  author = {Joongho Kim and Xirui Huang and Zarreen Reza and Gabriel Grand and Kevin Zhu and Ryan Lagasse},
  title = {{Chopping Trees: Semantic Similarity Based Dynamic Pruning for Tree-of-Thought Reasoning}},
  booktitle = {ER @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=6xrbjd86dF},
}
Figure