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

Stylianos Loukas Vasileiou, William Yeoh

TL;DR

TRACE-CS is a hybrid AI system that pairs the rigorous, provable logic of symbolic reasoning with the conversational ease of Large Language Models (LLMs) to explain course scheduling decisions. By using a SAT solver to handle the "thinking" and an LLM to handle the "talking," it achieves 100% accuracy in answering complex user queries—vastly outperforming pure LLM approaches.

What Problem Does This Paper Address?

Automated scheduling is everywhere, from managing hospital shifts to planning Mars rover activities. However, these systems often act as "black boxes." When a student asks, "Why can't I take Algorithms in my third semester?" a typical system might just say "No" or provide a dense, logical proof that is unintelligible to a non-expert.

The challenge lies in a fundamental trade-off:

  1. Symbolic Logic methods are mathematically sound and can prove exactly why a schedule fails, but they output "logic-speak" that humans find difficult to parse.
  2. Large Language Models (LLMs) are excellent at natural conversation but struggle with the precise, multi-step logical reasoning required for constraint satisfaction. They often "hallucinate" plausible-sounding but factually incorrect reasons for scheduling conflicts.

The authors introduce TRACE-CS (Trustworthy ReAsoning for Contrastive Explanations in Course Scheduling) to bridge this gap, creating a system that is both logically sound and user-friendly.

Methods

TRACE-CS uses a "synergistic" architecture that divides labor between two main modules, as shown in the workflow below:

Figure 1: The TRACE-CS workflow.

1. The Symbolic Module (The "Brain")

  • Encoder: Translates university degree requirements, prerequisites, and credit limits into a Boolean satisfiability (SAT) problem.
  • Explainer: When a user asks a question, this module identifies the Minimal Unsatisfiable Set (MUS)—the smallest possible set of constraints that make the user's request impossible. This ensures the explanation is focused and not cluttered with irrelevant rules.

2. The LLM Module (The "Voice")

  • Query Parser: Uses an LLM (GPT-4) to translate a user's natural language question (e.g., "Why not Course X instead of Y?") into a formal logical query.
  • User Verification: A critical safety step where the system asks the user to confirm it interpreted their question correctly before proceeding.
  • Explanation Refiner: Takes the dry logical output from the Explainer and translates it back into a coherent, friendly natural language response.

Datasets

The system was evaluated using real-world data from a Bachelor of Science in Computer Science program.

  • Course Data: Over 200 courses including core requirements, electives, and general education.
  • Constraints: Scraped from official university catalogs, including complex prerequisite chains (e.g., "Analysis of Algorithms" requires "Data Structures," which requires "Intro to CS").
  • Evaluation Set: 550 contrastive queries of varying complexity, ranging from simple single-course questions to complex queries involving six different courses.

Key Insights and Ideas

  • The "LLM-Modulo" Framework: Rather than asking the LLM to solve the logic problem, TRACE-CS uses the LLM as a sophisticated interface. This prevents the "hallucination" issues common in pure LLM systems.
  • Minimalism Matters: By using symbolic methods to find the minimal set of conflicting constraints, the system avoids "information overload." A pure LLM tends to list every rule it can find, whereas TRACE-CS points directly to the specific bottleneck.
  • Trust through Verification: The inclusion of a verification step (Step 3 in Figure 2) ensures that the system doesn't waste time solving the wrong logical problem due to a linguistic misunderstanding.
Figure 2: The TRACE-CS interface showing the explanation workflow: (1) course schedule display across 8 semesters; (2) user query input; (3) query verification step with user confirmation; and (4) generated explanation output.

Key Results

The authors compared TRACE-CS against a baseline of a pure LLM (GPT-4) provided with all the same scheduling data. The results, summarized in the table below, highlight a stark contrast in reliability:

Table 1: Comparative evaluation results between TRACE-CS and GPT-4.1.
  • Accuracy: TRACE-CS achieved 100% accuracy across all complexity levels. In contrast, the pure LLM averaged only 54.1%, with its performance dropping as queries became more complex.
  • Verbosity: TRACE-CS produced much more concise explanations (averaging ~82 words) compared to the LLM (~159 words), which tended to include unnecessary information.
  • Speed Trade-off: The pure LLM was faster (~4 seconds) than TRACE-CS (~14 seconds). However, the authors argue that for high-stakes academic planning, a 10-second wait is a small price to pay for a guaranteed correct answer.

Limitations and Future Work

  • Model Sensitivity: The study focused on GPT-4. Newer models with better "Chain-of-Thought" reasoning might improve the LLM baseline, though the authors suspect the fundamental logic gap will persist.
  • User Experience: While the explanations are logically minimal, the authors note that future work should include user studies to determine if humans actually prefer these minimal explanations over more comprehensive ones.
  • Scalability: While demonstrated on course scheduling, the hybrid architecture is designed to extend to other constraint-heavy domains like logistics and resource allocation.

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},
}

Loading related content...

Figure