Skip to main content
Sandbox Physics
Trusting posteriors learned from simulations

How can you tell whether a neural network's posterior deserves trust?

Sandbox Physics ·

Start with simulated signals from known sources. Count how often the network’s 90% region contains the source, then compare the network with a reference calculation under the same model. For real data, also check which features of the signal and noise the model can explain.

A bell that rings for a few milliseconds

When two black holes merge, the new black hole settles down by ringing like a struck bell. The gravitational wave it sends out is a tone that fades within milliseconds. The pitch and the fading time carry the black hole's mass and spin, so measuring those two numbers from a noisy detector record is a real scientific task.

The classical way is slow. A computer tries millions of candidate tones, scores each one against the data and keeps the ones that fit. A neural network can be trained to skip that search. It sees millions of simulated records, each made from a known tone plus random noise, and learns to go straight from a record to the answer. After training it takes seconds.

What the network gives back

The answer is not a single pitch and fading time. It is a cloud of possible values, denser where the values are more plausible. Statisticians call this cloud the posterior: what you should believe about the source after seeing the data. Draw a boundary around the densest 90% of the cloud and you get a 90% region.

If you draw each source from the prior and simulate its data with the same model used for inference, the true source should land in the region about nine times in ten. That is calibration at the 90% level, averaged over those simulated sources. At a single fixed source the rate can differ.

Testing the promise on simulations

Because the network learned from simulations, you can make fresh simulations and check its promise directly. Pick a source at random, make a noisy record, ask the network for its 90% region and note whether the true source is inside. Repeat a few thousand times and count. Sean Talts and colleagues turned this into a standard test in 2018, along with a picture that shows how a posterior fails: too narrow, too wide or shifted to one side. Talts and colleagues, 2018

The DINGO network for gravitational waves passed this test in 2021. Maximilian Dax and colleagues ran it on 1000 simulated signals in simulated detector noise and found that, for each parameter, the fraction of true values inside each region sat close to the promised line. Dax and colleagues, 2021

A second opinion from the slow method

The simulation test is an average over many sources. A network could be right on average and still wrong for the kind of source you care about. So the second check compares the network, record by record, with a reference calculation under the assumed model. DINGO's answers for eight real events agreed closely with the established slow method. The differences were only slightly larger than the differences between two runs of the slow method itself.

Where both tests stop

Both checks share a blind spot. They assume the simulator describes the real detector. Real data hold things the simulator left out: a short burst of instrument noise called a glitch, noise that is louder than expected, or a second tone the model did not include. The network has never seen these, and nothing in its training tells it what to do with them.

The 2023 follow-up used importance weights to check the network on each record. Each weight accounts for how plausible a candidate is under the model and how often the network proposes it. Large differences between weights warn that a few draws carry most of the result. On a signal-free record with a glitch, the estimated effective sample fraction was about one in 100,000. Dax and colleagues, 2023

Even that check has a limit. It tests the network against the assumed model, not the model against nature. Suppose the real signal contains a faint second tone that the model lacks. The exact calculation and the network both fit the wrong model, both agree with each other, and both pass the reweighting check, yet their 90% regions miss the true source far more often than one time in ten. A study of neural methods on deliberately wrong simulators in 2022 found that this kind of mismatch can badly damage the answers, and that none of the fixes they tried worked in every case. Cannon, Ward and Schmon, 2022

Questions to ask of any fast posterior

Ask whether it was tested on simulations with known answers, and whether those tests looked at the kind of source and noise level you care about. Ask whether it was compared with an exact or slow method on the same data. Ask whether reweighting concentrated the result in a few draws. For the model itself, check what is left after subtracting the best-fit signal and see how the inference changes with a richer model.

Sources

  1. Talts and colleagues, 2018
  2. Dax and colleagues, 2021
  3. Dax and colleagues, 2023
  4. Cannon, Ward and Schmon, 2022

Keep reading

What this page links to directly

You are hereHow can you tell whether a neural network's posterior deserves trust?

Articles

See this series on the content map →

Trusting posteriors learned from simulations · Reading path

From a posterior to calibration and model mismatch

  1. You are hereHow can you tell whether a neural network's posterior deserves trust?
  2. ArticleWhat a posterior and a 90% credible region promise
  3. ArticleChecking posterior calibration with ranks and coverage
  4. ArticleFinding a wrong simulator with importance weights and residuals
  5. ArticleRecompute the ringdown posterior calibration
  6. ArticleReading the DINGO evidence: P–P plots, divergences and sample efficiency
Something broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy