Does Unsupervised Domain Adaptation Improve the Robustness of Amortized Bayesian Inference? A Systematic Evaluation

Lasse Elsemüller, Valentin Pratz, Mischa von Krause, Andreas Voss, Paul-Christian Bürkner, Stefan T. Radev · DOI

Introduction

Amortized Bayesian Inference (ABI) has emerged as a powerful framework for Simulation-Based Inference (SBI), enabling rapid parameter estimation by training neural networks on large-scale simulated datasets. Once trained, these models can perform near-instantaneous inference on real-world observations. However, the efficacy of ABI rests on a fundamental assumption: the simulator must accurately reflect the underlying generative process of the real-world data.

In practice, this assumption is frequently violated. Real-world data often contains unmodeled noise, structural discrepancies, or outliers—phenomena collectively known as model misspecification. When faced with such out-of-distribution data, standard amortized networks often produce biased or overconfident posterior estimates. This paper systematically evaluates whether Unsupervised Domain Adaptation (UDA) can bridge this "simulation-to-reality" gap by aligning the internal representations of simulated (source) and real (target) data.

Methodology

The authors focus on Neural Posterior Estimation (NPE), a common ABI technique where a summary network compresses high-dimensional data into informative statistics, which are then fed into an inference network to estimate the posterior distribution. To improve robustness, they evaluate two UDA-enhanced variants:

  1. NPE-MMD: This method utilizes Maximum Mean Discrepancy (MMD) to minimize the statistical distance between the embeddings of simulated and real data in the summary space.
  2. NPE-DANN: Adapting Domain-Adversarial Neural Networks for the ABI context, this approach uses a domain classifier and a gradient reversal layer. The summary network is trained to "fool" the classifier, ensuring that the extracted features are domain-invariant.

A key conceptual contribution of the paper is the distinction between two inference targets. Standard inference aims for the posterior of the observed, potentially noisy data (Target 1). Conversely, UDA methods implicitly target the posterior of a "denoised" or idealized version of the data (Target 2) by forcing the network to ignore features that distinguish the real domain from the simulated one.

Experimental Framework

The methods were benchmarked across four scenarios designed to isolate different types of misspecification:

  • Ricker Model: A 2D population dynamics model used to explore hyperparameter sensitivity under data contamination.
  • 2D Gaussian Means: A controllable benchmark with an analytic posterior, used to test shifts in prior location/scale and likelihood scale.
  • Bayesian Denoising: A high-dimensional image task using MNIST (simulated) and USPS (real) to test prior shifts alongside blur and noise corruptions.
  • Implicit Association Test (IAT): A real-world application using the Diffusion Decision Model (DDM) to analyze human reaction time data.

Key Findings: The Likelihood-Prior Trade-off

The systematic evaluation reveals a critical dichotomy in UDA performance based on the nature of the misspecification:

1. Success in Likelihood Misspecification

UDA is highly effective when the discrepancy arises from the likelihood (e.g., unexpected sensor noise or corrupted pixels). By forcing domain invariance, the summary network learns to filter out unmodeled noise. In the 2D Gaussian benchmark, UDA-enhanced methods actually outperformed the exact analytic posterior. This occurs because UDA targets the "denoised" reality (Target 2), successfully ignoring outliers that would otherwise skew a standard mathematical posterior calculation.

2. Failure in Prior Misspecification

Conversely, UDA fails catastrophically when the misspecification occurs in the prior (e.g., when the true parameters of the real data lie outside the range of the simulated prior). In these cases, the discrepancy between domains contains the very information the network needs to identify the shift. By forcing the embeddings to align, UDA effectively destroys the signal required to correct for the prior mismatch, leading to poor inference.

3. The Challenge of Regularization

The performance of UDA is highly sensitive to the regularization weight ($\lambda$). If $\lambda$ is too low, no adaptation occurs; if it is too high, NPE-MMD suffers from "information collapse" (where the summary space loses all predictive power), and NPE-DANN becomes training-unstable. Tuning this parameter in real-world scenarios is a significant hurdle, as ground-truth parameters for real data are typically unavailable.

Real-World Application: The IAT Dataset

When applied to the IAT dataset, UDA successfully aligned the majority of the data. However, this alignment did not translate to improved inference for the most misspecified outliers. Interestingly, a simpler baseline—Noise-Augmented NPE (NNPE), which involves adding spike-and-slab noise during training—provided better fits for the misspecified real-world reaction times than the more complex UDA methods.

Conclusion

While Unsupervised Domain Adaptation offers a promising path toward robust Amortized Bayesian Inference, it is not a universal solution. Its success is strictly contingent on the type of model misspecification present. UDA excels at ignoring unmodeled noise (likelihood shifts) but can be detrimental when the simulator's prior is poorly specified. Future research should focus on developing more stable hyperparameter tuning strategies and exploring UDA's potential in amortized Bayesian model comparison, where its classification-based strengths may be more naturally utilized.

Summary updated

BibTeX
@article{elsemuller2025does,
  author = {Lasse Elsemüller and Valentin Pratz and Mischa von Krause and Andreas Voss and Paul-Christian Bürkner and Stefan T. Radev},
  title = {{Does Unsupervised Domain Adaptation Improve the Robustness of Amortized Bayesian Inference? A Systematic Evaluation}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=ewgLuvnEw6},
}
Figure