NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Combining LLMs with a Logic-Based Framework to Explain MCTS

Ziyan An, Xia Wang, Hendrik Baier, Zirong Chen, Abhishek Dubey, Taylor T. Johnson, Jonathan Sprinkle, Ayan Mukhopadhyay, Meiyi MaAAMAS 2025

Abstract

Monte Carlo Tree Search (MCTS) is a powerful algorithm for sequential planning, yet its decision-making process remains a "black box" due to the complexity of its search trees. While Large Language Models (LLMs) offer a potential interface for natural language explanations, they frequently hallucinate when reasoning over structured search data. This paper introduces LogiEx, a framework that bridges this gap by combining LLMs with Computational Tree Logic (CTL). By using formal logic as a grounding mechanism, LogiEx reduces hallucinations and improves explanation accuracy by up to 8x compared to standalone models.

Introduction

In complex sequential planning tasks—ranging from manufacturing to paratransit routing—MCTS is a preferred algorithm for its ability to simulate thousands of future paths. However, the resulting search trees are massive and nearly impossible for human experts to interpret. This lack of transparency hinders trust in AI-driven planning systems.

While LLMs are proficient at generating human-readable text, they struggle to reason accurately over the high-volume, low-level data produced by MCTS. When tasked with explaining a specific decision, standard LLMs often provide inconsistent justifications or invent facts. There is a critical need for a system that can translate the mathematical rigor of a search tree into the high-level reasoning humans require.

The LogiEx Framework

The authors propose LogiEx, a multi-step pipeline designed to generate factually grounded explanations. The framework operates through five key stages:

  1. Query Classification: The system first determines if a user's question is a post-hoc query regarding a specific decision or a background query regarding general domain knowledge.
  2. Logic Generator & Parser: For decision-based queries, the framework uses an LLM with few-shot prompting to translate the natural language question into a formal Computational Tree Logic (CTL) statement.
  3. Logic Scorer: This serves as the "grounding" engine. Instead of allowing the LLM to infer data, the Logic Scorer traverses the actual MCTS search tree to calculate numerical values or boolean truths based on the CTL statement. It handles three levels of evidence: base-level (single node info), derived (aggregated info), and logic comparison (path comparisons).
  4. Knowledge Retrieval (RAG): For background questions, the system utilizes Retrieval-Augmented Generation (RAG) to pull facts from a curated domain knowledge base.
  5. Explanation Generation: Finally, an LLM synthesizes the original query and the verified evidence from the Logic Scorer or RAG into a final, natural language response.

Experimental Setup and Results

The framework was evaluated using a paratransit planning scenario—a complex on-demand transit system for people with disabilities. The evaluation set consisted of 620 distinct queries covering various planning aspects, supported by a 3,000-word knowledge base of domain rules and MCTS mechanics.

The researchers compared LogiEx against "base" LLMs (Llama 3.1 and GPT-4o) using two primary metrics: FactCC (factual consistency) and BERTScore (semantic similarity).

Key Findings

  • Massive Accuracy Gains: Using Llama 3.1 as a backbone, the LogiEx framework achieved a 2.40x improvement in FactCC and a 7.92x improvement in BERTScore.
  • Superior Consistency: Even when using a high-performing model like GPT-4o, the framework improved factual consistency by 1.59x.
  • State-of-the-Art Performance: The "LogiEx (GPT-4o)" configuration reached a FactCC score of 72.12%, significantly outperforming standalone models.

Discussion

The core insight of this research is that symbolic grounding is essential for explainable AI (XAI). By forcing the LLM to generate a logic query rather than a direct answer, the system ensures that the final explanation is built on mathematical truth rather than probabilistic word prediction. Furthermore, the three-level evidence hierarchy allows the system to answer complex counterfactual questions (e.g., "Why was path A chosen over path B?"), which are traditionally difficult for XAI systems.

Limitations and Future Work

While promising, the framework currently faces several challenges. The Logic Scorer and variable definitions are currently domain-specific to paratransit and would require re-engineering for other applications like robotics or chess. Additionally, the computational overhead of CTL model checking and multi-step LLM calls may impact real-time performance. Future work will likely focus on generalizing the logic generation and reducing latency for high-stakes, real-time environments.

Conclusion

LogiEx demonstrates that the integration of formal logic with LLMs can transform MCTS from a black-box algorithm into an interactive, interpretable system. By grounding natural language in the mathematical reality of the search tree, this framework provides a path toward more reliable and trustworthy AI-driven planning.

Summary updated

BibTeX
@inproceedings{an2025combining,
  author = {Ziyan An and Xia Wang and Hendrik Baier and Zirong Chen and Abhishek Dubey and Taylor T. Johnson and Jonathan Sprinkle and Ayan Mukhopadhyay and Meiyi Ma},
  title = {{Combining LLMs with a Logic-Based Framework to Explain MCTS}},
  booktitle = {AAMAS},
  year = {2025},
}
Figure