Incorporating Interpretable Output Constraints in Bayesian Neural Networks

Wanqian Yang, Lars Lorch, Moritz A. Graule, Himabindu Lakkaraju, Finale Doshi-Velez

TL;DR

Researchers have developed Output-Constrained Bayesian Neural Networks (OC-BNNs), a framework that allows experts to bake "common sense" or safety rules directly into a model's prior. By defining constraints on what the model outputs rather than its internal weights, they achieve models that are both highly accurate and strictly compliant with domain-specific requirements like fairness or clinical safety.

What Problem Does This Paper Address?

Bayesian Neural Networks (BNNs) are powerful because they don't just give a prediction; they provide a measure of uncertainty. However, BNNs suffer from a "language barrier." Humans express expertise through functional rules (e.g., "a patient with low blood pressure shouldn't receive this drug"). In contrast, BNNs define their "beliefs" (priors) in terms of high-dimensional weight parameters, which are completely uninterpretable to humans.

Because of this, it is notoriously difficult to force a BNN to respect safety, fairness, or physical laws, especially in regions where training data is sparse. Standard BNNs might make "confident" but physically impossible predictions simply because they haven't seen enough data to know better.

Methods

The authors introduce the Conditional Output-Constrained Prior (COCP). Instead of trying to guess which weights are "good," they define a prior based on how well the model's output $y$ satisfies a constraint $C$ for a given input $x$.

Prior and posterior predictive plots demonstrating how an output constraint (red region) shapes the model's behavior before and after observing data.

Key technical components include:

  • The Constraint as Likelihood: They treat the satisfaction of a constraint as a "likelihood" function. If a set of weights $w$ produces an output that violates a rule, that $w$ is assigned a very low prior probability.
  • Flexible Formulations: They provide specific mathematical recipes for different types of rules, such as Positive Constraints (forcing the model to stay within a range) and Negative Constraints (forcing the model to avoid certain outputs).
  • Amortization (AOCP): They developed a variant that "learns" a prior across multiple tasks, making it computationally efficient to apply the same rules to new datasets.
  • Black-Box Compatibility: Because the constraint is handled at the prior level, OC-BNNs can be used with standard BNN inference algorithms like Variational Inference or Stein Variational Gradient Descent (SVGD).

Datasets

The paper validates the approach on synthetic "toy" problems and three high-stakes real-world datasets:

  1. MIMIC-III: A massive database of ICU clinical records used for predicting hypotension interventions.
  2. COMPAS: A dataset of criminal defendants used to test for racial bias and recidivism prediction.
  3. Give Me Some Credit: A Kaggle dataset for credit scoring, used to evaluate "recourse" (how a user can change their behavior to improve their score).

Key Insights and Ideas

  • Functional vs. Parametric: The "aha moment" is shifting the focus from the parameters (which no one understands) to the function (which experts understand).
  • Handling Biased Data: OC-BNNs can act as a "corrective lens." In the COMPAS experiment, the model was trained on racially biased data but given a fairness constraint. The OC-BNN successfully ignored the bias in the data to satisfy the fairness rule, whereas a standard BNN simply learned to be biased.
Demonstration of positive constraints (green regions, left) and negative constraints (red region, center) inducing multimodal posterior distributions.
  • Multimodality: Negative constraints (e.g., "don't go here") can naturally push the model to find multiple "safe" solutions. As seen in the visualizations, OC-BNNs can capture these distinct modes of behavior better than standard models, routing predictions around restricted zones.
  • Interpretability for Non-Experts: This framework allows a doctor or a judge to specify a rule in plain language (translated to a simple mathematical constraint) without needing to understand the underlying neural network architecture.

Key Results

  • Clinical Safety: On the MIMIC-III task, OC-BNNs reduced violations of physiological safety rules by six-fold compared to standard BNNs, while maintaining nearly identical predictive accuracy.
  • Fairness: In recidivism prediction, the OC-BNN equalized high-risk prediction rates across racial groups, whereas the baseline BNN showed a 3.5x difference in how it treated African American vs. non-African American defendants.
  • Actionable Recourse: In credit scoring, the OC-BNN produced models where users had to exert significantly less "effort" (changing their financial behavior) to flip a negative prediction to a positive one, aligning closer to ground-truth fairness.

Limitations and Future Work

  • Model Capacity: If the neural network is too small, it might not have the "room" to satisfy complex constraints and fit the data simultaneously, leading to unpredictable behavior.
  • Sampling Complexity: Evaluating constraints requires sampling the input space. While the authors show this is tractable for the dimensions they tested, it could become a bottleneck in extremely high-dimensional spaces (like raw image pixels).
  • Expert Error: The model is only as good as the constraints. If an expert provides a malicious or incorrect rule, the model will faithfully follow it, potentially leading to "principled" but wrong decisions. Future work could involve "robustness checks" to see when data and constraints are fundamentally at odds.

Summary updated

BibTeX
@inproceedings{yang2020incorporating,
  author = {Wanqian Yang and Lars Lorch and Moritz A. Graule and Himabindu Lakkaraju and Finale Doshi-Velez},
  title = {{Incorporating Interpretable Output Constraints in Bayesian Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=ucbeon-c2ln},
}
Figure