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 ·

You test it three ways. First, give it thousands of simulated signals whose true source you know, and count how often its 90% range catches that source. Second, compare it with a slow exact calculation on the same data. Third, check whether the real data actually look like the simulations it learned from. The first two tests can be passed by a network that is still wrong about real data, which is why the third matters.

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.

That region makes a promise. Over many records, the true source should land inside it about nine times in ten. A region that is too tight catches the source less often; one that is too loose catches it almost always but tells you little. A posterior that keeps the promise is called calibrated.

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 slow calculation that is exact for 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 added a check for that. It takes the network's candidate answers and reweights each one by how well it actually fits the data under the assumed model. If the network has done its job, the weights come out nearly equal. If it is confused, a few candidates carry almost all the weight. On a record containing only a glitch, the useful fraction of candidates fell to about one in 100,000, and the record was flagged. 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. Then ask what was done to show that the real data look like the training simulations: a reweighting check, a test of what is left after subtracting the best-fit signal, or a comparison with a richer model. A beautiful posterior earns trust only after all three.

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

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