# You Only Derive Once (YODO): Automatic Differentiation for Efficient Sensitivity Analysis in Bayesian Networks

arXiv: https://arxiv.org/abs/2206.08687 · HTML: https://mlsanity.com/paper/2206.08687/

## Key facts

- Cited by 4 papers in the map (data through 14 Oct 2026).
- Builds on 9 of its 35 references that are in the map.
- First posted on arXiv 17 Jun 2022.

## Builds on (most cited first, 9 of 9)

- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [Automatic differentiation in machine learning: a survey](https://mlsanity.com/paper/1502.05767/) (2015)
- [A Differential Approach to Inference in Bayesian Networks](https://mlsanity.com/paper/1301.3847/) (2013)
- [Duality of Graphical Models and Tensor Networks](https://mlsanity.com/paper/1710.01437/) (2017)
- [Sensitivity and robustness analysis in Bayesian networks with the bnmonitor R package](https://mlsanity.com/paper/2107.11785/) (2021)
- [Making Sensitivity Analysis Computationally Efficient](https://mlsanity.com/paper/1301.3868/) (2013)
- [A geometric characterisation of sensitivity analysis in monomial models](https://mlsanity.com/paper/1901.02058/) (2018)
- [Sensitivity Analysis for Probability Assessments in Bayesian Networks](https://mlsanity.com/paper/1303.1470/) (2013)
- [Analysing Sensitivity Data from Probabilistic Networks](https://mlsanity.com/paper/1301.2314/) (2013)

## Built on by (most cited first, 4 of 4)

- [The YODO algorithm: An efficient computational framework for sensitivity analysis in Bayesian networks](https://mlsanity.com/paper/2302.00364/) (2023)
- [Global Sensitivity Analysis of Uncertain Parameters in Bayesian Networks](https://mlsanity.com/paper/2406.05764/) (2024)
- [The diameter of a stochastic matrix: A new measure for sensitivity analysis in Bayesian networks](https://mlsanity.com/paper/2407.04667/) (2024)
- [Finding an ε-close Variation of Parameters in Bayesian Networks](https://mlsanity.com/paper/2305.10051/) (2023)

## Abstract (arXiv)

Sensitivity analysis measures the influence of a Bayesian network's parameters on a quantity of interest defined by the network, such as the probability of a variable taking a specific value. In particular, the so-called sensitivity value measures the quantity of interest's partial derivative with respect to the network's conditional probabilities. However, finding such values in large networks with thousands of parameters can become computationally very expensive. We propose to use automatic differentiation combined with exact inference to obtain all sensitivity values in a single pass. Our method first marginalizes the whole network once using e.g. variable elimination and then backpropagates this operation to obtain the gradient with respect to all input parameters. We demonstrate our routines by ranking all parameters by importance on a Bayesian network modeling humanitarian crises and disasters, and then show the method's efficiency by scaling it to huge networks with up to 100'000 parameters. An implementation of the methods using the popular machine learning library PyTorch is freely available.
