A Deep Learning Method for Comparing Bayesian Hierarchical Models

Lasse Elsemüller, Martin Schnuerch, Paul-Christian Bürkner, Stefan T. RadevPsychological 2023 · DOI

TL;DR

This paper introduces a novel deep learning approach to Bayesian model comparison (BMC) for complex hierarchical models, which are notoriously difficult to analyze with traditional methods. By leveraging amortized inference and a permutation-invariant neural network architecture, their method enables efficient and robust model comparison, even for models with intractable likelihoods.

What Problem Does This Paper Address?

Bayesian model comparison (BMC) is a powerful tool for selecting the best computational model among a set of candidates. However, a major hurdle arises when dealing with hierarchical models (HMs), which are widely used in fields like psychology and cognitive science due to their ability to capture nested data structures. The high-dimensional and nested nature of parameters in HMs makes traditional BMC methods, which rely on marginalizing over these parameters, computationally intractable. This intractability becomes even more pronounced for models with "implicit likelihoods," where the model's generative process is defined by a simulator rather than an explicit mathematical function. This limitation restricts researchers' ability to compare complex, realistic models.

Methods

The authors propose a deep learning method that addresses the intractability of BMC for hierarchical models. Their approach builds upon the BayesFlow framework and utilizes a permutation-invariant neural network architecture. This architecture is designed to respect the inherent exchangeability of data within hierarchical levels, meaning the order of observations within a group or the order of groups themselves doesn't affect the model's output.

Key methodological components include:

  • Hierarchical Invariant Neural Network: This network processes nested data by applying invariant modules at each hierarchical level. These modules transform individual data points into intermediary embeddings, which are then pooled and further transformed to create a final summary representation.
  • Amortized Inference: Once trained, the neural network can perform model comparison on new data sets very quickly, without needing to re-fit the models. This is a significant advantage over traditional methods that require extensive computation for each new data set.
  • Simulation-Based Training: The network is trained using simulated data generated from the candidate models. This allows the method to handle models with implicit likelihoods, where explicit likelihood functions are unavailable.
  • Transfer Learning: To improve training efficiency, especially with limited simulation budgets, the authors explore pre-training networks on simpler data sets and then fine-tuning them on more complex or realistic data.

Datasets

The paper uses simulated datasets for training and validation across its studies.

  • Validation Study 1: Compares two hierarchical normal models. Simulated data sets vary in the number of groups (M) and observations per group (Nm).
  • Validation Study 2: Compares hierarchical Signal Detection Theory (SDT) and Multinomial Processing Tree (MPT) models from cognitive psychology. Simulated data sets are designed to be challenging to distinguish between these models.
  • Real-data Application: Uses data from Wieschen et al. (2020) on evidence accumulation models, reanalyzed using their deep learning method.

Key Insights and Ideas

  • Bridging the Gap for Complex Models: The core insight is that deep learning, specifically permutation-invariant networks, can effectively overcome the computational intractability of BMC for hierarchical models, opening the door to comparing more realistic and complex scientific models.
  • Amortization is Key: The ability to amortize the computational cost of model comparison through training is a game-changer, enabling rapid inference and extensive validation before applying the method to real data.
  • Implicit Likelihoods No Longer a Barrier: The simulation-based training approach liberates BMC from the requirement of explicit likelihood functions, a significant limitation for many modern computational models.
  • Transfer Learning for Efficiency: Pre-training networks on simpler tasks significantly speeds up the training process for complex models, making the method more practical.
  • Robustness to Data Perturbations: The method demonstrates robustness to variations in data set size and even artificial noise, suggesting its reliability in real-world applications.

Key Results

  • High Calibration and Accuracy: The proposed method achieves excellent calibration and accuracy, comparable to or exceeding the state-of-the-art bridge sampling method in simulation studies. For instance, in Validation Study 1, median ECE values were as low as 0.012, and median accuracy was around 0.88.
  • Efficiency Gains: The amortized nature of the neural network leads to substantial speedups in model comparison, especially when analyzing multiple data sets. For instance, in Validation Study 2, their method was significantly faster than bridge sampling for comparing cognitive models.
  • Successful Application to Intractable Models: The method successfully compared hierarchical evidence accumulation models with implicit likelihoods, a task previously deemed intractable.
  • Model Comparison in Real Data: The application to real data confirmed the method's ability to distinguish between complex models and provided insights into the relative performance of different evidence accumulation models.

Limitations and Future Work

  • Defining "Good Enough": The authors acknowledge that determining a universally "good-enough" performance score for an approximate BMC method remains challenging, as optimal performance is often application-specific and unknown.
  • Model Misspecification: While the method can detect model differences, it doesn't inherently measure the absolute evidence for a model or directly diagnose model misspecification in an "open-world" scenario (where none of the candidate models truly generated the data). Future work could explore combining their method with meta-uncertainty frameworks to address this.
  • Prior Sensitivity: As with all BMC methods, priors play a crucial role. The paper highlights the complexity of setting priors for HMs and suggests further research into prior predictive checks and sensitivity analyses.
  • Non-Exchangeable Models: The current architecture is designed for models with exchangeable data. Future work could extend the method to handle non-exchangeable hierarchical models, for example, by incorporating recurrent networks for time-series data.

Summary updated

BibTeX
@inproceedings{elsemuller2023deep,
  author = {Lasse Elsemüller and Martin Schnuerch and Paul-Christian Bürkner and Stefan T. Radev},
  title = {{A Deep Learning Method for Comparing Bayesian Hierarchical Models}},
  booktitle = {Psychological},
  year = {2023},
  doi = {10.1037/met0000645},
}
Figure