Formal Reasoning for Intelligent QA Systems: A Case Study in the Educational Domain

Tuan Bui, An Nguyen, Phat Thai, Minh Hua, Ngan Pham L. N., Ngan Pham T. B., Dung Le, Long Nguyen, Thanh-Tung Tran, Thang Bui, Tho QuanarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) have revolutionized natural language processing, yet they frequently falter in high-stakes domains requiring strict logical adherence. In academic environments, where graduation depends on complex, state-dependent rules, "hallucinations" or "post hoc rationalizations" can lead to incorrect advice. This paper introduces MCFR (Model Checking for Formal Reasoning), a neuro-symbolic framework designed to bridge the gap between linguistic flexibility and formal logical rigor.

The Challenge of Faithful Reasoning

While LLMs excel at generating plausible text, they often lack a causal grounding in the rules they describe. In the educational domain, questions like "Can I graduate in 8 semesters?" are not merely retrieval tasks; they are temporal reachability problems. Standard LLMs often ignore sequential constraints—such as prerequisite chains that physically require a minimum number of semesters—leading to logically impossible answers. MCFR addresses this by treating reasoning as a state-aware verification problem rather than a text-completion task.

The MCFR Framework

MCFR utilizes a "NeSy Type 2" sequential neuro-symbolic pipeline that offloads logical execution from the LLM to a formal model checker.

The MCFR neuro-symbolic pipeline architecture.

The pipeline consists of four key stages:

  1. Offline Model Building: Institutional rules are encoded into a formal transition model using UPPAAL, representing the system as a network of timed automata.
  2. Parsing: An LLM acts as a translator, converting natural language questions into Computation Tree Logic (CTL) specifications.
  3. Formal Verification: The UPPAAL model checker exhaustively explores the state space to determine if the CTL property holds within the defined model.
  4. Natural Language Synthesis: The verification results and execution traces are converted back into a human-readable explanation by the LLM.

Benchmarking with EduMC-QA

To evaluate the framework, the authors developed EduMC-QA, a dataset of 129 questions based on real-world academic procedures at the Ho Chi Minh City University of Technology. Questions are categorized into four verification types: Safety (preventing invalid actions), Liveness (ensuring eventual goals), Reachability (pathfinding to specific states), and Fairness (evaluating non-discriminatory blocking).

Examples of natural language questions translated into UPPAAL queries with corresponding answers and traces.

Key Results and Insights

The study demonstrates that LLMs are far more effective as translators than as logical solvers. MCFR achieved an overall accuracy of 93.85%, significantly outperforming ChatGPT-reason (82.31%) and DeepSeek (76.92%). Notably, Claude-Sonnet struggled on this benchmark, achieving only 40% accuracy.

MCFR showed particular strength in Liveness (97.06%) and Reachability (94.74%) tasks. These areas are typically difficult for LLMs because they require enforcing multi-step policy constraints that are implied by the rules but not explicitly stated in a single document. By exploring the state space, MCFR can answer "What if?" scenarios with mathematical certainty.

Limitations and Future Directions

The primary bottleneck for MCFR is the manual effort required to build the initial formal model (~56 person-hours for one department). Additionally, the system's accuracy is bounded by the LLM's ability to correctly parse natural language into CTL; a mis-translation results in a logically sound answer to the wrong question. Future research will focus on using LLMs to semi-automate model construction from raw policy text and integrating local consistency checks to improve scalability.

Summary updated

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
EduMC-QAChatGPT-reasonReasoning accuracy82.31%Question Answering · questions=130
Source quote
L295: ChatGPT-reason │ 73.53 │ 88.24 │ 84.21 │ 83.33 │ 82.31
BibTeX
@misc{bui2025formal,
  author = {Tuan Bui and An Nguyen and Phat Thai and Minh Hua and Ngan Pham L. N. and Ngan Pham T. B. and Dung Le and Long Nguyen and Thanh-Tung Tran and Thang Bui and Tho Quan},
  title = {{Formal Reasoning for Intelligent QA Systems: A Case Study in the Educational Domain}},
  year = {2025},
  eprint = {2509.11572},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.11572},
}
Figure