Why Machine Learning Models Systematically Underestimate Extreme Values II: How to Fix It with LatentNN
Yuan-Sen Ting
TL;DR
Attenuation bias causes neural networks to underpredict extreme values when inputs carry measurement errors, a problem particularly acute in astronomy where $\lambda_\beta = 1/(1 + (\sigma_x/\sigma_{\rm range})^2)$. LatentNN generalizes the errors-in-variables approach by introducing latent inputs $x_{\rm latent}$ and jointly optimizing them with network parameters $\boldsymbol{\theta}$ under a joint Gaussian likelihood, extending Deming regression to nonlinear function approximation. Across one-dimensional and multivariate synthetic tests, and in a stellar-spectra application, LatentNN consistently reduces attenuation bias (achieving $\lambda_y \approx 1$ for $\text{SNR}_x \gtrsim 2$ in many settings) while maintaining generalization, with performance depending on the number and structure of informative features. The method frames attenuation bias within a hierarchical Bayesian perspective (MAP of latent inputs), offers generalizations to heteroscedastic and non-Gaussian noise, and provides practical implications for spectroscopic surveys by yielding more accurate stellar parameters and abundances in low-SNR data; code is publicly available at the LatentNN repository.
Abstract
Attenuation bias -- the systematic underestimation of regression coefficients due to measurement errors in input variables -- affects astronomical data-driven models. For linear regression, this problem was solved by treating the true input values as latent variables to be estimated alongside model parameters. In this paper, we show that neural networks suffer from the same attenuation bias and that the latent variable solution generalizes directly to neural networks. We introduce LatentNN, a method that jointly optimizes network parameters and latent input values by maximizing the joint likelihood of observing both inputs and outputs. We demonstrate the correction on one-dimensional regression, multivariate inputs with correlated features, and stellar spectroscopy applications. LatentNN reduces attenuation bias across a range of signal-to-noise ratios where standard neural networks show large bias. This provides a framework for improved neural network inference in the low signal-to-noise regime characteristic of astronomical data. This bias correction is most effective when measurement errors are less than roughly half the intrinsic data range; in the regime of very low signal-to-noise and few informative features. Code is available at https://github.com/tingyuansen/LatentNN.
