Introduction
Bayesian Neural Networks (BNNs) are increasingly utilized in high-stakes domains such as healthcare and criminal justice due to their robust uncertainty quantification. However, a significant challenge remains: BNN priors are typically defined over a high-dimensional and uninterpretable parameter space (weights and biases). This makes it difficult for domain experts to incorporate functional constraints—such as safety limits or fairness criteria—directly into the model. This paper introduces Output-Constrained Bayesian Neural Networks (OC-BNNs), a framework that allows for the injection of interpretable, human-defined rules directly into the function space of BNNs.
Methodology
The authors propose defining constraints based on the model's output for a given input, rather than its internal parameters. Two primary approaches are introduced:
- Conditional Output-Constrained Prior (COCP): This method constructs a prior that assigns probability mass based on how well the BNN's output satisfies constraints on a set of input samples. By using specific distributions (e.g., Positive Dirichlet for classification or Negative Exponential for regression) to penalize violations, the prior acts as a drop-in replacement for standard priors in black-box inference algorithms like Hamiltonian Monte Carlo (HMC).
- Amortized Output-Constrained Prior (AOCP): To reduce the computational overhead of evaluating constraints during inference, the authors propose learning a variational approximation of the constrained prior offline. This learned prior can then be efficiently reused across multiple tasks.
Experimental Evaluation
The OC-BNN framework was validated across several high-dimensional, real-world datasets:
- MIMIC-III (Clinical Action Prediction): In predicting hypotension management, OC-BNNs reduced constraint violations by approximately 6x (from 78.3% to 13.6%) compared to baseline BNNs, while simultaneously improving the test $F_1$ score.
- COMPAS (Recidivism Prediction): By applying a demographic parity constraint, the OC-BNN corrected for historical racial bias in the training data, equalizing prediction rates between demographic groups despite the biased ground-truth labels.
- Give Me Some Credit (Credit Scoring): The model successfully applied actionability constraints to ensure young adults were not unfairly penalized for a lack of credit history, maintaining high predictive accuracy (~89%).
Discussion and Key Insights
A key finding is that OC-BNNs make the enforcement of "hard" constraints computationally viable. In standard BNNs, rejection sampling to ensure zero violations is often impossible because nearly 100% of samples are rejected. By steering the posterior toward the constrained region, OC-BNNs dramatically lower the rejection rate.
Furthermore, the framework naturally explores multimodal solutions. If a constraint allows multiple valid functional forms, the OC-BNN captures the full distribution of these valid functions rather than converging to a single mode.
Limitations
The authors note that model capacity plays a role in how constraints are satisfied, and the framework relies on the accuracy of the provided expert rules. Future work will focus on scaling these methods to even larger architectures and more complex constraint types.
Summary updated