TRACE-CS: A Hybrid Logic-LLM System for Explainable Course Scheduling

Stylianos Loukas Vasileiou, William Yeoh · DOI

Abstract

We present TRACE-CS, a novel hybrid system that combines symbolic reasoning with large language models (LLMs) to address contrastive queries in course scheduling problems. TRACE-CS leverages logic-based techniques to encode scheduling constraints and generate provably correct explanations, while utilizing an LLM to process natural language queries and refine logical explanations into user-friendly responses. This system showcases how combining symbolic knowledge representation (KR) methods with LLMs creates explainable AI agents that balance logical correctness with natural language accessibility, addressing a fundamental challenge in deployed scheduling systems.

Introduction

Automated scheduling systems are ubiquitous, managing everything from hospital shifts to complex academic degree plans. However, these systems often operate as "black boxes." When a user encounters a scheduling conflict—for instance, a student asking why they cannot take a specific course in a preferred semester—standard solvers typically provide either a simple "no" or a dense, unintelligible logical proof.

The challenge in creating explainable scheduling agents is two-fold. Symbolic methods, such as logic solvers, are perfectly accurate and consistent but produce "robotic" explanations that are difficult for non-experts to parse. Conversely, Large Language Models (LLMs) are excellent at natural language interaction but struggle with multi-step logical reasoning and consistency, often "hallucinating" reasons that do not exist within the underlying constraint set. TRACE-CS (Trustworthy ReAsoning for Contrastive Explanations in Course Scheduling) bridges this gap by creating a system that is both provably trustworthy and linguistically accessible.

The TRACE-CS Architecture

TRACE-CS utilizes a hybrid "LLM-modulo" architecture that partitions the workload between two specialized modules: a Symbolic Module for logical rigor and an LLM Module for natural language processing.

The TRACE-CS hybrid architecture, showing the interaction between the LLM Module and the Symbolic Module.

The Symbolic Module

This module serves as the system's logical engine. It employs an Encoder to translate university degree requirements and prerequisites into Boolean satisfiability (SAT) clauses. When a user submits a contrastive ("why not") query, an Explainer utilizes specialized algorithms to identify the Minimal Unsatisfiable Core (MUS). The MUS represents the smallest set of constraints that makes the user's request impossible, ensuring the explanation is focused only on the relevant conflict.

The LLM Module

Using GPT-4, this module handles the user interface. A Query Parser converts natural language into a formal logical representation. To ensure reliability, the system includes a User Query Verification step where the user confirms the system's interpretation before processing. Finally, an Explanation Refiner takes the raw logical constraints identified by the symbolic module and translates them into a coherent, natural language explanation.

Experimental Evaluation

The system was evaluated using a real-world dataset scraped from an official university catalog, encompassing over 200 courses with complex prerequisite chains. The researchers generated a test set of 550 contrastive queries, categorized by complexity levels (1 to 6) based on the number of courses involved in the query.

TRACE-CS was benchmarked against a "pure LLM" baseline, where GPT-4.1 was provided with all scheduling rules directly in its prompt to generate explanations without symbolic assistance.

Results and Discussion

The evaluation demonstrated a significant performance gap between the hybrid approach and the pure LLM baseline. TRACE-CS achieved 100% accuracy across all complexity levels, whereas the pure LLM's performance declined as query complexity increased.

Performance comparison between TRACE-CS and GPT-4.1 across different complexity levels.

As shown in the table above, TRACE-CS maintained perfect accuracy while producing significantly more concise explanations (averaging 81.8 words compared to 159.4 words for GPT-4.1). The pure LLM approach often included irrelevant or technically incorrect information, leading to an overall accuracy of only 54.1%.

While TRACE-CS is more accurate, it does introduce a latency trade-off. The hybrid system took an average of 14.7 seconds to generate a response, compared to 4.3 seconds for the pure LLM. However, in high-stakes domains like academic graduation requirements, the authors argue that logical correctness and the absence of hallucinations are worth the additional processing time.

Conclusion

TRACE-CS demonstrates that for complex reasoning tasks, LLMs are best utilized as translators and interface layers rather than primary reasoners. By anchoring the LLM's fluency in the formal guarantees of a symbolic solver, TRACE-CS provides a blueprint for trustworthy, explainable AI in constraint-heavy domains. Future work will focus on optimizing latency and conducting human-centric studies to measure student trust and helpfulness in real-world academic advising scenarios.

Summary updated

Abstract

We present TRACE-CS, a novel hybrid system that combines symbolic reasoning with large language models (LLMs)to address contrastive queries in course scheduling problems. TRACE-CS leverages logic-based techniques to encode scheduling constraints and generate provably correct explanations, while utilizing an LLM to process natural language queries and refine logical explanations into user friendly responses. This system showcases how combining symbolic KR methods with LLMs creates explainable AI agents that balance logical correctness with natural language accessibility, addressing a fundamental challenge in deployed scheduling systems.
BibTeX
@misc{vasileiou2024trace,
  author = {Stylianos Loukas Vasileiou and William Yeoh},
  title = {{TRACE-CS: A Hybrid Logic-LLM System for Explainable Course Scheduling}},
  year = {2024},
  eprint = {2409.03671},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.03671},
}
Figure