Are you using test log-likelihood correctly?

Sameer K. Deshpande, Soumya Ghosh, Tin D. Nguyen, Tamara Broderick

Introduction

Test log-likelihood (TLL) is the industry-standard metric for evaluating probabilistic models in Bayesian machine learning. It measures the average log-predictive density on held-out data, with the implicit assumption that a higher TLL indicates a more accurate model of the underlying data-generating process. However, this paper demonstrates that TLL can be a deceptive guide, particularly when models are misspecified or when the goal is posterior parameter accuracy.

The Problem with Test Log-Likelihood

In Bayesian analysis, we typically aim for two types of accuracy: posterior accuracy (how well our approximate distribution matches the true posterior) and predictive accuracy (how well we predict future values, often measured by RMSE). TLL is frequently used as a proxy for both.

The authors argue that this reliance is misplaced. TLL is an estimator of the expected log-predictive density (elpd), which is tied to the KL divergence in the predictive space, not the parameter space. Consequently, a model can achieve a high TLL while providing a poor representation of the true posterior or failing to minimize predictive error.

Experimental Evidence: The Coverage Trap

Through a series of controlled experiments using linear regression and Gaussian processes, the authors illustrate the "coverage trap." TLL rewards models that "cover" the observed data points well. If a model is misspecified—for instance, assuming constant noise when the true noise is heteroscedastic—an approximate posterior that is "too spread out" may achieve a higher TLL than the exact posterior.

Relationship between test log-likelihood and posterior accuracy. As the approximation moves further from the true posterior (increasing Wasserstein distance), the test log-likelihood paradoxically increases.

As shown in Figure 2, as the approximation (A-F) becomes increasingly over-dispersed and moves further from the true posterior (measured by 2-Wasserstein distance), the test log-likelihood actually improves. This suggests that optimizing for TLL can actively lead away from the true Bayesian posterior.

Model Misspecification

The discrepancies become even more pronounced under clear model misspecification. When fitting a linear model to quadratic data, a highly uncertain, over-dispersed predictive distribution captures the "outliers" created by the model's inability to follow the curve, thereby yielding a better TLL.

TLL under model misspecification. A linear model fit to quadratic data shows that over-dispersed approximations (F) achieve higher TLL than more concentrated ones (A), despite being further from the true parameter values.

In Figure 6, approximation (F) has a significantly higher TLL than (A), yet its parameter distribution is much further from the truth. Relying on TLL in such scenarios could lead researchers to conclude that a parameter has no effect (if the wide interval includes zero) when the true posterior indicates a clear effect.

TLL vs. RMSE

TLL and RMSE measure fundamentally different properties. RMSE focuses on the "center" of the predictive distribution (the mean), while TLL considers the entire distribution, including its width. A model can have a perfect mean but be penalized by TLL for slightly inaccurate uncertainty estimates. Conversely, a model with a poor mean can "buy" a better TLL by inflating its uncertainty to cover its errors.

In large-scale regression tests involving 100,000 training points, the authors found statistically significant contradictions where one model was preferred by RMSE while another was preferred by TLL, proving these issues persist even in the large-data limit.

Conclusion and Recommendations

The authors do not suggest abandoning TLL entirely but advocate for a more nuanced approach. Researchers should define their primary goal before selecting a metric:

  • Point Prediction: Use RMSE or similar metrics.
  • Uncertainty Calibration: Consider the Dawid-Sebastiani score.
  • Posterior Accuracy: Use diagnostics like Simulation-Based Calibration (SBC) or compare against gold-standard MCMC runs.

Ultimately, TLL is a measure of predictive fit, not a guarantee of scientific truth or posterior correctness.

Summary updated

BibTeX
@article{deshpande2024are,
  author = {Sameer K. Deshpande and Soumya Ghosh and Tin D. Nguyen and Tamara Broderick},
  title = {{Are you using test log-likelihood correctly?}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
  url = {https://openreview.net/forum?id=ol4VoL9DV8},
}
Figure