Table of Contents
Fetching ...

Uncertainty Quantification for Neurosymbolic Programs via Compositional Conformal Prediction

Ramya Ramalingam, Sangdon Park, Osbert Bastani

TL;DR

This work tackles uncertainty quantification for neurosymbolic programs by marrying conformal prediction with abstract interpretation to yield prediction sets that probabilistically contain the true program output. The method preserves correctness guarantees ($1-\epsilon$ coverage) while supporting composition across program modules and handling structured outputs such as lists or detections. It introduces direct, compositional, and full conformal semantics for loop-free and general imperative programs, with an extension to loops that maintains PAC-style guarantees. Empirical evaluation on MNIST and MS-COCO demonstrates reasonably sized prediction sets that achieve the desired coverage, indicating practical utility for conservative decision-making in vision-based queries against ML annotations.

Abstract

Machine learning has become an effective tool for automatically annotating unstructured data (e.g., images) with structured labels (e.g., object detections). As a result, a new programming paradigm called neurosymbolic programming has emerged where users write queries against these predicted annotations. However, due to the intrinsic fallibility of machine learning models, these programs currently lack any notion of correctness. In many domains, users may want some kind of conservative guarantee that the results of their queries contain all possibly relevant instances. Conformal prediction has emerged as a promising strategy for quantifying uncertainty in machine learning by modifying models to predict sets of labels instead of individual labels; it provides a probabilistic guarantee that the prediction set contains the true label with high probability. We propose a novel framework for adapting conformal prediction to neurosymbolic programs; our strategy is to represent prediction sets as abstract values in some abstract domain, and then to use abstract interpretation to propagate prediction sets through the program. Our strategy satisfies three key desiderata: (i) correctness (i.e., the program outputs a prediction set that contains the true output with high probability), (ii) compositionality (i.e., we can quantify uncertainty separately for different modules and then compose them together), and (iii) structured values (i.e., we can provide uncertainty quantification for structured values such as lists). When the full program is available ahead-of-time, we propose an optimization that incorporates conformal prediction at intermediate program points to reduce imprecision in abstract interpretation. We evaluate our approach on programs that take MNIST and MS-COCO images as input, demonstrating that it produces reasonably sized prediction sets while satisfying a coverage guarantee.

Uncertainty Quantification for Neurosymbolic Programs via Compositional Conformal Prediction

TL;DR

This work tackles uncertainty quantification for neurosymbolic programs by marrying conformal prediction with abstract interpretation to yield prediction sets that probabilistically contain the true program output. The method preserves correctness guarantees ( coverage) while supporting composition across program modules and handling structured outputs such as lists or detections. It introduces direct, compositional, and full conformal semantics for loop-free and general imperative programs, with an extension to loops that maintains PAC-style guarantees. Empirical evaluation on MNIST and MS-COCO demonstrates reasonably sized prediction sets that achieve the desired coverage, indicating practical utility for conservative decision-making in vision-based queries against ML annotations.

Abstract

Machine learning has become an effective tool for automatically annotating unstructured data (e.g., images) with structured labels (e.g., object detections). As a result, a new programming paradigm called neurosymbolic programming has emerged where users write queries against these predicted annotations. However, due to the intrinsic fallibility of machine learning models, these programs currently lack any notion of correctness. In many domains, users may want some kind of conservative guarantee that the results of their queries contain all possibly relevant instances. Conformal prediction has emerged as a promising strategy for quantifying uncertainty in machine learning by modifying models to predict sets of labels instead of individual labels; it provides a probabilistic guarantee that the prediction set contains the true label with high probability. We propose a novel framework for adapting conformal prediction to neurosymbolic programs; our strategy is to represent prediction sets as abstract values in some abstract domain, and then to use abstract interpretation to propagate prediction sets through the program. Our strategy satisfies three key desiderata: (i) correctness (i.e., the program outputs a prediction set that contains the true output with high probability), (ii) compositionality (i.e., we can quantify uncertainty separately for different modules and then compose them together), and (iii) structured values (i.e., we can provide uncertainty quantification for structured values such as lists). When the full program is available ahead-of-time, we propose an optimization that incorporates conformal prediction at intermediate program points to reduce imprecision in abstract interpretation. We evaluate our approach on programs that take MNIST and MS-COCO images as input, demonstrating that it produces reasonably sized prediction sets while satisfying a coverage guarantee.
Paper Structure (51 sections, 13 theorems, 75 equations, 9 figures, 6 tables)

This paper contains 51 sections, 13 theorems, 75 equations, 9 figures, 6 tables.

Key Result

Lemma 4.1

The direct conformal semantics $\llbracket p \rrbracket_{\epsilon}^{C0}(x,Z)$ satisfies (eqn:progconformal).

Figures (9)

  • Figure 1: (a) A program in our image query DSL that counts the number of people in an image within 300 pixels of the left-hand side of the image; $\widehat{f}$ produces a list of detections, the program filters out people within 300 pixels of the left-hand side, maps each remaining element to $1$, and uses a fold to sum the list. (b) The ground truth bounding boxes. (c) The bounding boxes predicted by $\widehat{f}$. (d) The prediction sets output by the conformal predictor $\tilde{f}$. (e) The ground truth semantics $\llbracket p \rrbracket^*(x)$ (evaluated using (b)) evaluates to 2. The standard semantics $\llbracket p \rrbracket(x)$ (evaluated using (c)) evaluates to 1. The direct conformal semantics $\llbracket p \rrbracket_{\epsilon_0}^{C0}(x,Z)$ evaluates to $(0, 2)$. The overall conformal semantics $\llbracket p \rrbracket_{\epsilon}^{C}(x,Z)$ evaluates to $(1, 2)$.
  • Figure 2: Example of our general framework applied to a program with loops.
  • Figure 3: The ground truth semantics for our imperative programming language (\ref{['eqn:implang']}).
  • Figure 4: The conformal semantics for our imperative programming language (\ref{['eqn:implang']}).
  • Figure 5: Dependence of relationship between set and interval abstractions on level of added noise and on $\epsilon$.
  • ...and 4 more figures

Theorems & Definitions (14)

  • Lemma 4.1
  • Lemma 4.2
  • Theorem 4.1
  • Theorem 5.1
  • Lemma A.1
  • Definition A.1
  • Lemma A.2
  • Lemma A.3
  • Lemma A.4
  • Lemma A.5
  • ...and 4 more