Neurosymbolic programs represent a powerful synthesis of deep learning's perceptual capabilities and symbolic logic's reasoning strengths. However, while traditional software is expected to produce deterministic, correct outputs, machine learning (ML) components are inherently fallible. This paper introduces a rigorous framework for Uncertainty Quantification (UQ) in neurosymbolic programs, providing mathematical guarantees that the program's output set contains the ground truth with a user-defined level of confidence.
The Challenge of Compositionality
In a typical neurosymbolic application—such as counting pedestrians in drone footage—a Deep Neural Network (DNN) detects objects, and a symbolic script filters and aggregates these detections. If the DNN misidentifies an object, the error propagates through the logic, leading to an incorrect final count.
Existing UQ methods for ML often focus on isolated models. To be effective for programs, UQ must be:
- Correct: Providing formal probabilistic guarantees (e.g., a 90% coverage guarantee).
- Compositional: Capable of handling uncertainty as it flows through filters, maps, and loops.
- Structured: Applicable to complex outputs like lists or spatial coordinates rather than just simple classification labels.
Methodology: Merging CP and Abstract Interpretation
The authors bridge two distinct fields to solve this problem: Conformal Prediction (CP) and Abstract Interpretation.
- Conformal Prediction: A statistical technique that transforms a "point prediction" into a "prediction set" using a calibration dataset. It ensures that the true value is contained within the set with a probability of at least $1-\epsilon$.
- Abstract Interpretation: A classic programming language analysis technique that represents sets of values as "abstract" shapes, such as intervals (e.g., $[2, 5]$).
The framework operates by applying CP to individual ML components and then using abstract interpretation to "push" these uncertainties through the program's logic. For imperative programs with while loops, the authors employ fixed-point semantics and dynamic calibration to ensure the statistical assumptions of CP remain valid across different execution paths.
Key Insights: The Power of Intersection
A central contribution of this work is the "Full" approach, which combines Direct Conformal Semantics (predicting the final output directly) with Compositional Conformal Semantics (propagating uncertainty from the inputs). By intersecting these two sets using the meet operator ($\sqcap$) from lattice theory, the framework produces significantly smaller and more precise prediction sets without compromising the safety guarantee.
Experimental results showed that using Interval Abstractions was approximately 10x faster than exact set representations with negligible loss in precision, making the framework viable for real-time applications.
Experimental Evaluation
The framework was evaluated on two primary benchmarks:
- MNIST Digit Lists: Synthetic programs performing operations like
sumormaxon noisy handwritten digits. - MS-COCO Object Detection: Real-world images used for complex spatial queries, such as "find the maximum distance between two people."
Across all tests, the framework successfully maintained the target coverage. In MNIST tests, the "Full" approach produced sets that were 1.23x smaller than the direct approach and 1.52x smaller than the compositional approach, proving that intersection is key to maintaining precision in complex programs.
Conclusion and Future Work
This research provides a foundational step toward building reliable neurosymbolic systems. By providing formal guarantees on output sets, it allows autonomous agents to make safer decisions based on the range of possible truths. Future work will explore more intuitive scoring functions for complex logic and the integration of these prediction sets into downstream decision-making processes for robotics.
Summary updated