arXiv:2610.12379cs.LGOct 2026

Manuscript Offprint

arXiv:2610.12379

Marformer: A Transformer for Predicting Missing Data Distributions

Prabhav Singh, Xiheng Tom Wang, Haojun Shi, Jason Eisner

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Prabhav Singh ∗^{*}

School of Computing, College of Natural Sciences

The University of Texas at Austin, Austin TX

prabhavs@cs.utexas.edu

Xiheng Tom Wang ∗^{*}

Department of Computer Science

Johns Hopkins University, Baltimore MD

xwang397@jh.edu

Haojun Shi ∗^{*}

Department of Computer Science

Yale University, New Haven, CT

haojun.shi@yale.edu

Jason Eisner

Department of Computer Science

Johns Hopkins University, Baltimore MD

jason@cs.jh.edu

Abstract

Real decisions are made under incomplete information. If we observe only some of the random variables we need, we can predict the others. The conditional marginals over the missing variables are the key ingredient for computing Bayes risk and Value of Information (VOI), the expected gain from acquiring one more observation before deciding. We present the MARFORMER, a Transformer trained to directly predict conditional marginals given any set of observed values. Like BERT, which is trained to predict missing words from context, the MARFORMER constructs a hidden-vector representation for each distribution p(Xi)p(X_i) and iteratively refines it through attention to other distributions p(Xj)p(X_j). Unlike generative approaches, the MARFORMER does not model the full joint distribution, requires no domain knowledge of the data-generating process, and makes all predictions in a single forward pass. We evaluate across three synthetic domains with missing data—Bayesian networks, discretized multivariate Gaussians, and structured annotation data. The MARFORMER can match or outperform classical missing-data methods, even when those methods are given the true model family and prior that generated the synthetic data. We also evaluate on a real annotation dataset, where the MARFORMER outperforms the evaluated baselines at the largest training size. In both cases, the MARFORMER is substantially faster than the evaluated generative baselines.

1 Introduction

Incomplete data is the rule, not the exception, in scientific and applied settings. A recommender system has a user's opinions of only a few movies. A standardized testing agency has only a few graders' opinions of each essay. The incomplete data may be acquired adaptively: A doctor does just enough tests to choose a treatment confidently. An engineer runs cheap simulations to decide which candidate molecules or hyperparameter settings are worthy of further measurements. An educational tester or job interviewer probes adaptively for strengths and weaknesses, using a limited budget. An evaluator of an AI system adaptively selects examples based on observed performance, using the results to predict performance on other examples (Li et al., 2024). In each case, the decision-maker needs not a point estimate of the missing values but a predictive distribution

∗^{*}Equal contribution, order determined randomly. The work was conducted while all authors were at Johns Hopkins University.

over them given the available evidence. With such distributions, one can quantify residual uncertainty, predict the risk of a possible action, or determine whether gathering more data before acting would be worth the cost.

In this paper we focus on marginal predictions. Our goal is to train a neural network that can predict the marginal distribution of any single missing value conditioned on any subset of the remaining values. We fit these conditional marginals directly by conditional maximum likelihood, a frequentist approach that requires no prior over the model parameters. As we explain in §2.2, such a model is directly useful for deciding among real-world actions and for choosing what additional information (missing values) to acquire before this decision. Our architecture is generic and offers fast, amortized, trainable inference of all the individual missing values in parallel. We also point out in §2.2 that such a model can jointly impute multiple missing values, if needed, by sampling them sequentially. Thus, our (possibly incoherent) collection of conditional distributions contains as much information as a joint distribution—but in a form designed to support conditional inference.

The classical Expectation-Maximization approach proceeds in the opposite direction: from joint to conditional. It first obtains a joint distribution over all values by fitting a full generative model to the incomplete data, using the maximum likelihood principle (EM: Dempster et al., 1977) or the maximum a posteriori principle if a prior is available (MAP-EM: Gentle et al., 1996, §1.6.1). One then performs inference as needed to extract the desired conditional marginals from this joint distribution.

Unfortunately, EM or MAP-EM (i) requires domain expertise to specify the generative model family and any prior; (ii) can encounter local optima when fitting the model parameters; and (iii) may require intractable inference, necessitating variational or sampling-based approximations that can be slow or inaccurate.

A more sophisticated variant is Bayesian posterior imputation (Tanner et al., 1987; Gelfand & Smith, 1990), which integrates out the posterior uncertainty about the generative model's parameters, typically by using MCMC to (approximately) sample them jointly with the missing values. The samples of the missing data can then be used to estimate the desired conditional marginal distributions. 1^{1} Training (ii) is thus absorbed into inference (iii), whose MCMC will escape local optima if run long enough. However, training/inference is still expensive to do accurately, and model specification (i) is still challenging.

In short, these classical methods have serious practical weaknesses—as we will demonstrate experimentally. The model is commonly misspecified because the domain is poorly understood or challenging to model. Such violations of (i) can lead to inaccurate results. (ii) and (iii) mean that even a correctly specified model family may produce poor results. Finally, (iii) slows down training as well as runtime prediction. This is particularly burdensome for online training: e.g., if the model is used to guide the acquisition of missing observations (as we discuss in §2.2), it is natural to immediately use these to improve the model parameters, so training continues indefinitely.

This is why we propose to abandon the hypothesized generative model—even when it is correct!—and simply fit all the conditional marginals directly. For this we use a generic neural model with enough capacity to do the job (one can select the neural network's size via cross-validation). Deep learning has been remarkably successful at fitting naturally occurring distributions. In contrast to the classical methods, training an overparameterized neural network does not adopt restrictive modeling assumptions, 2^{2} may bring useful inductive bias of its own (Neyshabur et al., 2017), tends not to get trapped in bad local minima (Sun et al., 2020), and can be designed to directly predict the target distributions, making inference fast and end-to-end trainable.

To flesh out this program, we propose a specific neural architecture that we hope is suitable for many domains: a MARFORMER (Conditional Marginal Transformer). The architecture is illustrated in Figure 2. Its key properties are:

  1. Observation of values. Each input to the MARFORMER specifies a set of random variables together with their values, some of which may be missing.

1^{1}Known in this Bayesian context as posterior predictive distributions.

2^{2}This resembles the argument for nonparametric statistical tests: “[E]ven when the parametric assumptions hold perfectly true, we will see that nonparametric methods are only slightly less powerful [i.e., statistically efficient] …Furthermore, if the parametric assumptions about the data fail to hold, only the nonparametric method is valid” (Kvam et al., 2022).

Figure

Figure 1: The complete instance x at top reveals values only for attributes in r\mathbf{r} (black), where (x,r)∼P∗(\mathbf{x}, \mathbf{r}) \sim P^*. Thus, our methods receive only the incomplete instance xr\mathbf{x}_r at bottom. In this example, xr\mathbf{x}_r is used both as a test instance and as a training instance (transductive learning). At test time, a model is evaluated (top) by its ability to predict individual missing values (red) from the observed values xr\mathbf{x}_r (black). It predicts a distribution for each red attribute and is rewarded if this distribution assigns high probability to the true value. At training time, the MARFORMER (right) trains to predict masked values (blue) from seen values xs\mathbf{x}_s (black). Many different masks s are used. In contrast, a classical generative model (left) trains to jointly predict all observed variables (blue) from nothing, using the missing variables (white) as latent variables.

  1. Prediction of parameters. The MARFORMER outputs marginal distributions for all variables, conditioned on the observations in the input. More precisely, for each variable, it outputs a parameter vector that will be interpreted as specifying a predictive distribution over that variable's domain.

  2. Conditional log-likelihood maximization. The training objective is conditional log-likelihood. That is, the predicted marginal over an unknown quantity should assign a high log-probability (or log-density) to its true value. This objective encourages predictions to match the true conditional distributions, which can subsequently be used to evaluate decisions under any task-specific loss (Gneiting & Raftery, 2005). We discuss empirical calibration in §6.6.

  3. Amortized, single-pass inference. Once trained, the MARFORMER predicts all missing marginals simultaneously in a single forward pass, sharing computation across the entire set of missing values. Its architecture (Figures 2a and 2b) generalizes BERT (Devlin et al., 2019), which specifically predicts conditional marginals over all missing words in a natural-language sentence. As in BERT, each variable can attend to the evolving predictions of the other variables as their representations are transformed layer by layer.

  4. End-to-end differentiable training. Inference is fully defined by this forward pass. Thus, training the MARFORMER to maximize conditional log-likelihood is explicitly optimizing the parameters to make inference accurate (Stoyanov et al., 2011; Hershey et al., 2014). In contrast, classical approaches train a joint model without considering the errors that may later be introduced by approximate inference.

  5. Support for relational domains. Many machine learning methods train and test on many partially observed samples that are assumed i.i.d. However, a relational task domain may have only a single partially observed sample with very many interrelated variables: the observed variables are observed only once, and the missing variables are never observed. Predicting the missing values is still possible, via shared parameters that model recurring relationships among variables. For joint modeling of relational domains, many suitable formalisms have been developed (Ginestet, 2010), although inference is generally expensive because it requires some form of message passing among the many variables. We extend the MARFORMER architecture ( §3.1§3.1) to also handle such domains, using a relational attention mechanism (Shaw et al., 2018) whereby related variables know their relationships and can learn to attend to one another.

Now the obvious question: How can we train a MARFORMER? Specifically, to supervise the prediction of missing data, where do we acquire the true values? The self-supervised learning recipe (e.g., Devlin et al., 2019; He et al., 2021) randomly masks out some variables, and trains a model to predict their masked values. The traditional recipe starts with complete data, and often trains prediction only for its side effect of representation learning. In contrast, we start with incomplete data, and predicting missing values is our actual goal. Yet (like Du et al., 2023) we can follow the same masking recipe—randomly mask out some of the observed values and train the model to predict them from the remaining observed values (Figure 1). We hope that the MARFORMER model will generalize from predicting these masked values to predicting the originally missing values. As we show in §2.4, this is reasonable to expect provided that the originally missing variables are missing completely at random (MCAR) and we mask additional variables using a missing-at-random (MAR) mechanism. (We review missingness mechanisms in §2.3.)

Our main synthetic evaluations use MCAR data, for which this masking recipe has the justification given in §2.4. We also report exploratory MAR evaluations in §A, where that justification does not automatically apply, and evaluate on a naturally sparse real annotation dataset (§7.1), for which MCAR is an unverified assumption. In a sequel paper, we will generalize to training MARFORMERS on MAR data—the same setting where EM works—using a more complex training recipe that is beyond the scope of the present paper. 3^{3}

The present paper suffices to study the MARFORMER architecture itself, showing that it can successfully model many conditional distributions at once. It can learn from modestly sized datasets, and it generalizes well from predicting masked values at training time to predicting the actually missing values at test time. Most important, it is competitive with the classical approaches even when they know the true model and prior.

§2 motivates and formalizes the problem. §3 describes the architecture and training. §§4–6 present experiments in three synthetic domains of increasing complexity. §7 evaluates the method on real annotation data. §8 discusses other related work, and §9 discusses limitations and future directions.