Abstract
In this paper, we examine the use of Conformal Language Modelling (CLM) alongside Answer Set Programming (ASP) to enhance the performance of standard open-weight LLMs on complex multi-step reasoning tasks. Using the StepGame dataset, which requires spatial reasoning, we apply CLM to generate sets of ASP programs from an LLM, providing statistical guarantees on the correctness of the outputs. Experimental results show that CLM significantly outperforms baseline models that use standard sampling methods, achieving substantial accuracy improvements across different levels of reasoning complexity. Additionally, the LLM-as-Judge metric enhances CLM's performance, especially in assessing structurally and logically correct ASP outputs. However, calibrating CLM with diverse calibration sets did not improve generalizability for tasks requiring much longer reasoning steps, indicating limitations in handling more complex tasks.
Introduction
Large Language Models (LLMs) have demonstrated impressive capabilities in natural language generation, yet they remain "unreliable narrators" for multi-step logical reasoning. They frequently hallucinate logical steps and struggle with tasks requiring precise spatial orientation. This paper introduces a neuro-symbolic framework that combines Conformal Language Modelling (CLM) with Answer Set Programming (ASP) to make LLM reasoning more robust and verifiable. By generating a statistically guaranteed set of logical "scaffolds" rather than a single greedy guess, we demonstrate that mid-sized models like Llama-3 can achieve high accuracy when backed by formal logic and conformal guarantees.
Problem Statement: The Challenge of Scaffold Uncertainty
Neuro-symbolic AI attempts to bridge the gap between neural fluency and symbolic precision by using the LLM as a translator that converts natural language into formal logic (e.g., ASP). A symbolic solver then executes this logic to find the "ground truth." However, this creates a bottleneck known as scaffold uncertainty. If the LLM’s translation into logic contains even a minor error—such as a syntax mistake or a flipped predicate—the symbolic solver fails entirely. This research addresses the challenge of generating reliable, verifiable intermediate logical representations under such uncertainty.
Methodology
The core of our approach is Conformal Language Modelling (CLM), an extension of Conformal Prediction. Unlike standard decoding methods that select the most likely token, CLM generates a set of potential outputs. This set is constructed to provide a rigorous statistical guarantee: with a user-defined probability (e.g., 95%), the set will contain at least one "acceptable" response.
Key Components
- ASP Scaffolding: We utilize In-Context Learning (ICL) to prompt a Llama-3-8B model to translate spatial stories into ASP facts and rules.
- Syntactic Admission: An "admission function" using the
clingoASP solver ensures that only syntactically valid ASP programs are included in the conformal set. - LLM-as-Judge: Standard NLP metrics like ROUGE-L are often inadequate for evaluating code, where minor character changes can lead to total failure. We fine-tuned a separate LLM to act as a similarity metric, comparing the log-probabilities of generated ASP samples to identify logically sound structures.
- Calibration: The system is calibrated on a small dataset to determine the optimal parameters ($\lambda$) that balance the size of the generated set against the required accuracy guarantee.
Experimental Setup
We evaluated our framework using the StepGame dataset, a benchmark for spatial reasoning. In this task, models are given sentences describing relative positions (e.g., "Agent A is left of B," "B is above C") and must determine the relationship between two specific agents. The dataset varies in complexity by "hops"—the number of reasoning steps required—ranging from 1 to 15. Our study utilized over 465,000 datapoints for training, validation, and testing.
Results and Discussion
Our experimental results demonstrate a significant leap over baseline models using standard greedy sampling.
Accuracy and Resilience
On 1-hop tasks, the CLM approach achieved 80.0% accuracy, a stark contrast to the 45.0% achieved by the baseline. This resilience persists as complexity increases; for 5-hop tasks, CLM maintained 65.0% accuracy, while the baseline performance dropped to 28.5%.
The Role of Formal Logic and Metrics
The use of a symbolic solver as an admission function provides an objective "ground truth" for quality. Furthermore, our LLM-as-Judge metric consistently outperformed ROUGE-L, particularly as reasoning complexity increased. For instance, it provided a ~1.5% absolute gain on 3-hop tasks for the Calib. 1-5 set, as it better captures the nuances of logical structure compared to simple n-gram overlap.
The Generalization Wall
Despite the success on shorter sequences, the system encountered a "generalization wall." Accuracy plummeted to 0.5% on the 15-hop test set. This suggests that while conformal prediction effectively manages uncertainty within the training distribution, it does not fundamentally grant the model new reasoning "depth" for significantly longer chains.
Conclusion
This study demonstrates that combining Conformal Language Modelling with symbolic scaffolds significantly enhances the robustness of LLM reasoning. While the approach provides substantial gains in accuracy and reliability for multi-step tasks, limitations remain regarding out-of-distribution generalization to extreme reasoning depths. Future work will investigate the distribution of conformal set sizes to better understand task complexity and compare this neuro-symbolic approach against "pure" LLM reasoning to further isolate the benefits of symbolic scaffolding.
Summary updated