NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Augmenting Neural Networks with Priors on Function Values

Hunter Nisonoff, Yixin Wang, Jennifer ListgartenarXiv 2022

Abstract: The need for function estimation in label-limited settings is common in the natural sciences. At the same time, prior knowledge of function values is often available in these domains. For example, data-free biophysics-based models can be informative on protein properties, while quantum-based computations can be informative on small molecule properties. How can we coherently leverage such prior knowledge to help improve a neural network model that is quite accurate in some regions of input space -- typically near the training data -- but wildly wrong in other regions? Bayesian neural networks (BNN) enable the user to specify prior information only on the neural network weights, not directly on the function values. Moreover, there is in general no clear mapping between these. Herein, we tackle this problem by developing an approach to augment BNNs with prior information on the function values themselves. Our probabilistic approach yields predictions that rely more heavily on the prior information when the epistemic uncertainty is large, and more heavily on the neural network when the epistemic uncertainty is small.

Introduction

In the natural sciences, researchers often face a "Goldilocks" dilemma when selecting modeling frameworks. Physics-based models are theoretically grounded and offer broad generalizability, yet they are computationally expensive and often only "roughly" accurate. Conversely, deep learning models provide exceptional accuracy within the distribution of their training data but are prone to being "wildly wrong" when forced to extrapolate into unseen regions of the input space.

Nisonoff et al. propose a novel middle ground in their paper, "Augmenting Neural Networks with Priors on Function Values." They introduce fv-BNNs (function-value-prior-augmented Bayesian Neural Networks), a framework that allows for the direct injection of domain expertise—such as biophysical stability or chemical properties—into a neural network's predictive process. This method ensures that the model naturally relies on scientific domain knowledge when it is uncertain and on empirical training data when it is confident.

The Challenge of Weight-Space Priors

Standard Bayesian Neural Networks (BNNs) allow practitioners to specify "priors"—initial beliefs—about the model's internal weights ($\theta$). However, for a biologist or chemist, translating a high-level domain insight, such as "this protein variant is likely unstable," into a specific distribution of neural network weights is nearly impossible. There is no clear, intuitive mapping between the weight space of a deep network and the functional properties of the system being modeled.

Furthermore, while BNNs provide a measure of "epistemic uncertainty" (identifying what they do not know), they lack a mechanism to utilize that uncertainty effectively during extrapolation. When a standard BNN moves far from its training data, its predictions can become erratic. While "data-free" models (like Rosetta for proteins) exist to guide these regions, there has historically been no coherent probabilistic method to blend these external priors with the neural network's learned representations.

Methodology: Function-Value-Prior-Augmented BNNs

The core innovation of the fv-BNN is the Function-Value-Prior. Instead of placing a prior solely on the weights, the authors place a prior directly on the function values ($f(x)$). The approach follows a three-step logic:

  1. The BNN Base: The process begins with a standard BNN (utilizing techniques like Laplace approximation or Deep Ensembles), approximating its posterior as a Gaussian Process (GP) with a diagonal covariance.
  2. Product of Experts: A new prior is defined as a product of the standard BNN prior and the new function-value prior.
  3. The Uncertainty-Driven "Switch": Mathematically, the final prediction becomes a weighted average (a convex combination) of the BNN's prediction and the prior's prediction.

The weighting is determined by the BNN’s own internal uncertainty. If the BNN is certain (typically near training data), its prediction dominates. If the BNN is uncertain (in extrapolation regions), the model "pulls back" toward the domain-specific prior.

Comparison of a standard BNN (left) and fv-BNN (right). The fv-BNN leverages its uncertainty to revert to a domain-specific prior in regions far from training data, preventing erratic extrapolation.

Experimental Evaluation

The authors evaluated fv-BNNs on three challenging tasks in the natural sciences:

  • avGFP (Green Fluorescent Protein): Predicting the fluorescence of protein variants.
  • GB1 (Protein G domain B1): Predicting binding affinity.
  • Aqueous Solubility: Predicting the solubility of small molecules in water.

A key insight from these experiments was the effectiveness of the "Zero-Mean" prior. In protein modeling, simply assuming that most random mutations result in zero fitness—encoding the biological reality that most mutations are deleterious—significantly improved model performance. This is a fundamental truth that standard neural networks do not inherently possess.

Results

The fv-BNN consistently outperformed standard neural networks, standard BNNs, and simple ensembling methods across all key metrics, including Log-Likelihood, RMSE, and MAE. Unlike "stacking" methods, which simply train a secondary model to combine outputs, fv-BNN uses the internal uncertainty of the BNN to decide how much to trust the prior in a mathematically coherent way.

Performance comparison on the GB1 binding affinity task. fv-BNN variants consistently achieve higher log-likelihoods and lower error rates (RMSE/MAE) than standard BNNs and stacking methods.

As shown in the results for GB1 binding affinity, the fv-BNN with a "stability prior" (derived from the Rosetta biophysics tool) achieved a significantly better Log-Likelihood (-0.57) compared to a standard BNN (-0.91). Similar robust improvements were observed across the protein fluorescence and molecule solubility datasets.

Conclusion and Future Work

The fv-BNN framework provides a powerful tool for scientific machine learning by bypassing the need to map function-value beliefs into weight space. However, some limitations remain. To maintain tractability, the current implementation assumes a diagonal covariance, meaning uncertainty at one point is treated as independent of another. This ignores potential correlations between similar test points. Additionally, the method's success is tied to the BNN's calibration; if a BNN is "confidently wrong," the system will not know to revert to the prior. Future research may explore non-diagonal matrices to capture these correlations and investigate validation strategies that better simulate the extreme extrapolation challenges found in real-world scientific discovery.

Summary updated

BibTeX
@misc{nisonoff2022augmenting,
  author = {Hunter Nisonoff and Yixin Wang and Jennifer Listgarten},
  title = {{Augmenting Neural Networks with Priors on Function Values}},
  year = {2022},
  eprint = {2202.04798},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.04798},
}
Figure