Manuscript Offprint
arXiv:2610.12379Marformer: A Transformer for Predicting Missing Data Distributions
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
Xiheng Tom Wang
Department of Computer Science
Johns Hopkins University, Baltimore MD
Haojun Shi
Department of Computer Science
Yale University, New Haven, CT
Jason Eisner
Department of Computer Science
Johns Hopkins University, Baltimore MD
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 and iteratively refines it through attention to other distributions . 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. 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, 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:
- Observation of values. Each input to the MARFORMER specifies a set of random variables together with their values, some of which may be missing.
Known in this Bayesian context as posterior predictive distributions.
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 1: The complete instance x at top reveals values only for attributes in (black), where . Thus, our methods receive only the incomplete instance at bottom. In this example, 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 (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 (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.
-
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.
-
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.
-
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.
-
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.
-
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 ( ) 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.
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.
2.1 Notation for Attributes and Values
We assume that our training and test instances are i.i.d. samples from some unknown probability distribution . To describe an instance's attributes, the underlying sample space is equipped with a collection of random variables named by the elements of the fixed index set . Each random variable has some domain . We write for the entire random collection , which has domain . For example, if , then can be identified with the random tuple with values of the form .
For in the domain of and , let denote the subcollection : that is, a dictionary or function that maps each attribute to its value . (Note that one may recover from as the domain of this map.) Applying this subscripting operation to , we obtain the corresponding random subcollection with domain . Note that and .
By abuse of notation, even when does not refer to any object, we may use to refer to a possible value of (and to refer to a possible value of ), implying that (and ).
2.2 Conditional Marginals and Their Uses
Our goal is to train a single MARFORMER to model all of the conditional marginal distributions , where , , and . The conditioning values are said to be seen and are provided to the MARFORMER in its input.
Like EM, that recipe uses the current model to impute missing values. We will impute using the MARFORMER itself.
This generalizes the task of modeling —the central problem of prequential statistics (Dawid, 1984), which shares our focus on predicting one unseen variable but is limited to forecasting the next step in a time series.
Why? First, it is simple to extract a point prediction of a variable from its conditional marginal. The Bayesian optimal prediction is the one with minimum expected loss (Bayes risk) given the observations so far:
Under or loss, for example, is the conditional mean or conditional median of .
Marginal distributions predict only one variable at a time. Fortunately, once we can condition on arbitrary subsets of observations, we can chain these conditional marginal predictions to obtain conditional joint predictions as needed. The additional conditioning values in this chain may be hypothetical or sampled rather than observed. For example, for any distinct ,
and we can drop in MARFORMER estimates of both factors. This generalizes autoregressive prediction, in a manner previously explored by orderless NADE (Uria et al., 2016) and XLNet (Yang et al., 2019). The generalization is important: because the MARFORMER specifies all conditional distributions, it is fast to evaluate the two factors of (2), or to sample and then from them. In contrast, under the autoregressive (“factored regression”) models widely used in the previous missing data literature (Lipsitz & Ibrahim, 1996; Enders, 2023), those operations would require expensive marginalization or importance reweighting, except when the fixed autoregressive order happens to include the specific factors that appear in (2).
Making a point prediction like (1) can be regarded as choosing an action. One can also use probabilities to evaluate real-world actions with task-specific losses. The application defines the available actions and their losses; the MARFORMER supplies the conditional predictions used to evaluate them. After observing , the distribution (2) suffices to choose among actions whose losses depend on the state of the world only through the state's attributes and (and optionally ). The Bayes risk of a possible action is again its expected loss, now under the conditional joint distribution (2):
The Bayes-optimal action is . For example, a doctor may wish to assess each candidate treatment after observing symptoms . Equation (3) does so by marginalizing over an unseen disease and an unseen patient preference , both of which are imputed from using the MARFORMER. It may be convenient to approximate the expectation (3) by Monte Carlo, sampling and as mentioned above. The same samples can be reused to compute the Bayes risks of alternative candidate actions .
An important speedup is available here. Since the loss of is a deterministic function of random variables such as and , it is a random variable itself. Suppose we call it . Then is the conditional expectation , as in equation (1). We can again drop in the MARFORMER's estimate of the conditional marginal here—provided that we had the forethought to include in the MARFORMER's training, and provided that the MARFORMER can directly predict as accurately as it estimates it via equations (2) and (3). Given that investment in training, this approach is much faster at prediction time. It no longer requires an expectation over many chained pairs. A single call to the MARFORMER is now enough to predict the Bayes risk of and also, in parallel, other candidate actions .
Is it worth gathering more information before choosing an action? Conditional marginals enable active feature acquisition (Saar-Tsechansky et al., 2009), which repeatedly chooses a next attribute to observe until further acquisition would no longer improve expected outcomes enough to justify its cost. The value of information (VOI) of observing in the preceding example is the expected reduction in loss, considering how this new information changes the chosen action from to the possibly different (Howard, 1965; 1966):
This can be computed using exactly the same conditional marginals as in equation (3). is worth observing if its VOI exceeds the corresponding cost of information (COI), that is, the expected cost of observing . (This cost is often a constant known in advance, but in general it is just another random variable for the MARFORMER to predict.) Heuristically, one may choose a next variable to observe by maximizing (Saar-Tsechansky et al., 2009), which represents the immediate rate of return on investment (ROI).
In short, conditional marginals serve to guide decision-making about which action to take and which information to gather first.
In this paper, we focus on making conditional marginal estimation straightforward, fast, and accurate, using a generic model rather than a bespoke model for the domain. For this purpose we will assume fixed training and test distributions. In a sequel paper, we will attempt to train a policy for incrementally acquiring conditioning variables that usefully inform some downstream decision, along with training all conditional marginal distributions that the policy consults on the data that it gathers (Li & Oliva, 2020).
2.3 Predicting From Conditional Marginals on Incomplete Data
Often we must work with incompletely observed data—for example, whatever active feature acquisition has collected so far. To model incomplete datasets with stochastically missing attributes (Rubin, 1975; Little, 2021), the probability space from §2.1 is also equipped with a set-valued random variable that specifies which attributes are observed (“revealed”). The other attributes are missing. Thus, an instance has and gives rise to the observed instance that appears in training or test data. We refer to as the complete instance. may be factored into the complete-data distribution and the missingness mechanism .
Incomplete data methods can have subtle bugs. The rest of this section ensures correct prediction on incomplete test instances. The next section ( 2.4) ensures asymptotically correct estimation from incomplete training instances. Some readers may prefer to skip this material on a first reading and proceed to 2.5.
Example: Let . If nature provides and then chooses to reveal attributes , then we observe the instance . We then expect the missing value to be distributed according to the conditional marginal .
The prediction in this test example takes care to condition on , since the observation pattern is itself observed and is potentially useful—the fact that and were stochastically missing may provide an additional clue about their values. In contrast, the subtly different notation refers to the simpler distribution , which is derived from only , with no dependence on the missingness mechanism . This notation does not mention : it treats as a given constant, rather than as a realization of the random variable .
In this paper, we train MARFORMER models (as well as classical models) of this simpler distribution. Both distributions marginalize over the unmentioned variables ( in the example). They can be related through Bayes' Theorem:
MNAR: In the general missing not at random (MNAR) case, predicting missing values requires not only our trained model but also knowledge of the missingness likelihood factor in (6). That factor cannot be learned from the observed instances alone (Molenberghs et al., 2008).
IMAR: However, the missingness likelihood factor can clearly be dropped if it is known to be constant with respect to . Let us say that the missingness mechanism is individually missing at
This is a myopic (i.e., greedy) heuristic in the sense that it only considers the benefit and cost of the single next acquisition. In a sequel paper, we will train a MARFORMER-based information acquisition policy by reinforcement learning, which can look farther into the future if desired. Fully discounting the future turns out to retrieve the myopic ROI heuristic, or more precisely, an improved version that replaces the ratio-of-expectations with an expected ratio.
random (IMAR) if the probability of the specific observation pattern is independent of the individual missing value , given the observed values: , for all , , and . On the resulting incomplete instances , the predictive distribution in equation (6) is always identical to the modeled distribution. So an IMAR mechanism is ignorable for our task of predicting an individual variable: the mechanism's factor can always be dropped from equation (6) without knowing anything else about it. This is a new definition.
MAR: The traditional missing at random (MAR) property (Rubin, 1975; Seaman et al., 2013) strengthens IMAR to guarantee ignorability for the more difficult task of predicting all missing variables jointly. Simply replace with throughout (6). The “modeled distribution” factor would now be defined by chaining as in equation (2). The missingness likelihood factor becomes , and MAR states that it is always constant with respect to all of , so that it can again be dropped. That is, given the observed values, the probability of the observation pattern does not depend on any function of the missing values (e.g., whether ). More concisely, MAR states that .
Conveniently for our future applications, a dataset constructed by active feature acquisition is always MAR. The acquisition policy has no access to currently missing attributes, so the probability of observing attributes and then stopping (that is, ) cannot depend on any still missing attributes.
MCAR: Stronger still is the missing completely at random property, , which states that the missingness pattern does not depend on at all (not even on its observed part ). Note that MCAR does not require i.i.d. missingness—it allows variables to be missing at different rates, and allows their missingness to be correlated, as long as the missingness pattern is selected without looking at .
2.4 Training Conditional Marginals on Incomplete Data
We now discuss possible training strategies. In general, a conditional model can be trained by conditional maximum likelihood estimation (CMLE):
where the sum is over i.i.d. draws from , known as training examples. This is essentially a way of fitting to . Even when is misspecified, meaning that no yields the true exactly, CMLE will still asymptotically minimize the following weighted average of divergences:
In other words, CMLE asymptotically fits to for all such that . When no can do this exactly, CMLE favors fitting the distributions whose is larger. It may also converge faster to those distributions, since they are better represented in the training data. For both reasons, one may wish to choose to favor conditions that are similar to the expected test-time queries .
CMLE for conditional marginals. Recall from §2.2 that our goal is to fit a conditional model to match . Since CMLE will match the conditional distributions in the training examples, this means that the distribution of training examples needs to satisfy . In this setup, each training or test example will have the form . The input is an observation of paired with a target attribute , and the target output is the true value of .
For an example of a mechanism that is not MAR but is still IMAR: Suppose assigns equal probability to , and , and both and are missing if , but otherwise neither is missing. Observing that both variables are missing carries information about the pair , but not about the individual variables and .
Interestingly, the converse is false: it is possible to construct a MAR distribution that does not correspond to any acquisition policy, but this is not obvious. We found an example using Gurobi.
Notice that the sum in (7) is a finite-sample estimate of (8), up to an affine transform.
This follows from regarding equation (7) as maximum-likelihood estimation (MLE) of the compound model , for any fixed distribution with at least the support of . Thus, CMLE inherits all the usual guarantees of MLE. In particular, under regularity conditions, MLE still converges at rate to the minimum of —even in the “quasi-MLE” setting where the compound model is misspecified (White, 1982). It follows that CMLE converges to the minimum of (8).
Training instances vs. training examples. Many training examples of the above form—single predictions—can be derived from a single observed training instance , by masking out some of the observed attributes and training the MARFORMER to predict them individually. Simply choose and derive examples corresponding to . All of these examples have the same MARFORMER input , so conveniently, their terms in equation (7) can all be computed at once in a single forward pass.
Observability bias. Unfortunately, in the resulting distribution of training examples, may not match the conditionals of as required. The problem may arise even when the data are MAR and the masking mechanism is MCAR! Example: Let . Say is always observed, but is much more likely to be observed when than when . Like all dynamically acquired datasets, this dataset will be MAR. In particular, given , whether is then observed ( ) is independent of 's value. This lets us safely learn by masking the observed values (with some fixed probability) and learning to predict them. However, we cannot safely learn in the same way. Suppose the complete-data distribution assigns , , , probabilities of 0.4, 0.1, 0.1, 0.4 respectively. Then , whereas unfortunately, few training examples with have . That is because such training examples are derived from instances in which was observed at all, which tend to have due to the missingness mechanism.
MNAR+MNAR: In the general case of MNAR training instances and an MNAR masking mechanism, we could correct for observability bias through inverse propensity weighting. For each condition (x_s, i), we would adjust the conditional distribution in masked training examples, , to match the distribution we wish to model, . The two distributions are related just as in equation (6), so weighting each masked training example by corrects (while distorting ). Alas, we generally do not know that weighting factor, which depends in a complex way on both the missingness and masking mechanisms and on the complete-data distribution.
But suppose that weighting factor does not depend on . In other words, suppose the combined missingness+masking mechanism is IMAR, yielding IMAR masked instances . Then the mechanism is ignorable, just as we saw beneath equation (6): the two distributions already match. In other words, we can avoid observability bias simply by obtaining IMAR masked instances. How can we accomplish that?
MAR+IMAR: Given MAR training instances, we saw above that even MCAR masking suffers from observability bias. However, we could impute missing variables like to obtain complete instances. We can then mask the complete instances with any IMAR mechanism, which does not know what was originally missing (i.e., masking now chooses and not ). This produces IMAR instances as needed. As we will show in a sequel paper, the imputation can be done by the MARFORMER itself, on an as-needed basis, with no further knowledge of the missingness mechanism. This is morally the same approach as Monte Carlo EM (Wei & Tanner, 1990), but it trains a collection of conditional distributions rather than a single generative model.
MCAR+IMAR: As the present paper focuses on proving out the MARFORMER architecture, we can be less concerned with its source of training examples. We accordingly simplify by requiring the training instances to be MCAR. In this special case, neither weighting nor imputation is necessary. Any IMAR masking mechanism for choosing will produce IMAR masked instances, which yield training examples with the correct conditional distributions .
To formalize this point: A masking mechanism is a conditional distribution that is used to generate masked data from incomplete data. It is MAR if . More weakly, it is IMAR if (for all ), meaning that the masking pattern does not depend on any individual masked
These are the training examples with , , . On these examples, .
value . The combined mechanism—MCAR missingness followed by IMAR masking—produces IMAR data as desired: .
In short, provided that the original incomplete training instances are MCAR, we can simply use IMAR masking to produce new IMAR instances, for which the supervision provided by the masked values is unbiased.
In terms of the discussion after equation (8), we have now satisfied the core requirement to match the data distribution's conditionals to the desired conditionals , obtaining conditionally unbiased data. We do not need to also match to the distribution of test inputs—but doing so would give better results when has insufficient capacity to fit perfectly. Both and are over prediction queries . We again leave this problem to future work on deriving training examples. In the experiments we describe below, is already reasonably close to .
Remark. The presentation in §§2.3–2.4 has assumed that both training and test instances are drawn from the same . Using the same complete-data distribution is what ensures that the trained model can be applied to test data, as in most machine learning. However, the missingness mechanisms do not really have to be the same—for example, training might include more complete instances (§7.1). The missingness mechanism on a training instance informs the masked-data training strategy (§2.4), while the missingness mechanism on a test instance plays the different role of informing prediction (§2.3 and equation (6)).
2.5 Experimental Setup
Our experimental setup for this paper is diagrammed in Figure 1. The training examples and test examples that could be derived from a given instance are distinct. At training time, we would mask some of 's observed attributes and train to predict them (predicting from for all ). At test time, however, we would predict the actually missing attributes (predicting from for all ).
Actually evaluating these test-time predictions requires knowing the complete instance x. Thus, the test set Test consists of pairs drawn i.i.d. from . We evaluate with log-loss, a proper scoring rule that rewards for matching the true conditional distributions in test data (Gneiting & Raftery, 2005). Our
This is slightly stronger (closer to MAR) than the IMAR condition for the missingness mechanism (§2.3). We still marginalize over other masked attributes as before. However, we do not marginalize over the observation pattern , but rather require the independence to hold separately for each , even though will also be masked (i.e., it is not seen as part of ).
Proof: multiply the left- and right-hand sides of the defining IMAR equality by and respectively. Then sum over to obtain the desired result. The multiplication step preserves equality because both multipliers equal due to the MCAR missingness mechanism. To see this for the second multiplier, . The same argument applies to the first multiplier.
Several techniques seem promising. Given a dataset of training inputs and a sample of test inputs (all of the form in our setting), covariate shift methods show how to reweight the training examples to focus training on test-like inputs (Bickel et al., 2009), effectively replacing with in the weighted average (8). Gradient alignment goes further: it attempts to dynamically upweight the parts of the that benefit training (Ren et al., 2018; Shu et al., 2019). For example, training on may improve performance on held-out training examples with test-like inputs, even if is not itself a test-like input (i.e., is low) but merely has some similar properties. Although reweighting methods reduce the effective sample size, we are free to tune so as to mitigate this (that is, tune the IMAR masking function to generate examples that need less reweighting). We can further improve effective sample size by sampling training examples from an (arbitrarily biased) proposal distribution instead of , and correcting for this by multiplying the weight of example by an importance weight , provided that covers the support of the target distribution. Adaptive importance sampling (Bugallo et al., 2017) trains so as to maintain effective sample size: the highly weighted examples will now be proposed more often so that they do not have to be weighted as highly. In our setting, must select a training instance and also mask it; we can freely learn any selection distribution and any masking mechanism (perhaps sharing parameters with the MARFORMER), as long as we can compute the importance weight efficiently.
A more general presentation allows several data sources, where data from a given source is distributed as . It is this conditional distribution that may be MAR, MCAR, etc. The special source variable is observed on every instance and thus can inform the masking or prediction strategy on that instance. Training data may be drawn from one mixture of sources, and test data from a different mixture. Notice that if a test source has probability 0 in training, then the generalization of the trained MARFORMER to this novel value depends entirely on the inductive bias of the MARFORMER. Omitting from the MARFORMER input imposes a strong inductive bias, forcing it to use the same conditional model for all sources.
specific evaluation loss in this paper is
Note that equation (9) evaluates only on its marginal predictions (not on chained joint predictions as in equation (2)). It assumes that the test instances are IMAR, so that it can ignore the missingness mechanism in equation (6) and simply make the predictions directly from .
In effect, equation (9) converts the test instance (x, r) into test examples that will be individually evaluated by log-loss. It also weights all test examples equally. (An applied setting should evaluate instead on the test predictions that are useful for the application, changing the weighting .) Test instances with smaller will generate more test examples and thus contribute more terms to equation (9). We report the result in units of nats per example, dividing the total loss (9) by the total number of examples .
In settings where we know the true distribution that governs , we can ignore and more directly evaluate the marginal predictions by measuring their divergence from the true marginals, replacing (9) with
We train the model using a training set Train of incomplete MCAR training instances together with an IMAR masking mechanism . Following the discussion in §2.4, we may locally minimize the training objective
which stochastically converts a training instance into equally weighted training examples for CMLE. We use a stochastic gradient method so that the instances along with their masking patterns can be sampled randomly during training, according to the expectations in equation (11). Equation (19) below adds regularization to this objective, and footnote 13 discussed possibilities for reweighting its various summands.
In our present experiments, we use a very simple masking mechanism: each has a 15% independent probability of being masked. As in BERT (Devlin et al., 2019), the 15% number is intended to be small enough that the masked training inputs are not distributed too differently from the unmasked test inputs , yet large enough that we obtain several training examples each time we sample an instance .
We will compare to classical generative modeling as discussed in §1. These methods have access to the same Train and Test sets and evaluate with the same equation (9). However, they do not convert the training instances into conditional training examples as in equation (11). Instead they fit a joint model to maximize the joint log-posterior, which—when Train is MAR—is
plus an ignorable constant. Train is MCAR and therefore MAR in our present experiments.
Some of our experiments make the test inputs available at training time, which is known as transductive learning (Vapnik, 1998; Ouchi et al., 2019). More precisely, Train includes all incomplete test instances . These are only test inputs; of course, the desired test outputs are not seen during training! Transductive MARFORMER training will mask the test inputs to obtain additional training examples. With this paper's simple masking strategy, that works only if Test is MCAR (like the rest of Train), not just MAR.
The reason we train transductively is to compare fairly to Bayesian MCMC ( ), which is naturally transductive. The MCMC sampler operates on training and test data together, sampling from the joint posterior over parameters and missing values; making it non-transductive would be difficult and expensive.
Many users of the MARFORMER might prefer to apply it in the usual non-transductive manner: train with no advance knowledge of the test inputs, then run it on the stream of test inputs. Skipping the training on the test inputs ignores potentially useful information, but is much faster at test time than any transductive method. We evaluate this case as well and show that it has comparable accuracy at large training sizes.
3 A Neural Architecture for Conditional Marginal Prediction
3.1 Marformer Architecture
We now present our neural model . Given the observation (where may be any subset of ), the MARFORMER predicts a conditional marginal distribution over , for all attributes in parallel.
-
The first step of the forward pass is to encode the observed input as a collection of vectors. This is analogous to how a text Transformer encodes a length- input sentence (Vaswani et al., 2017) that may have missing tokens (Devlin et al., 2019) into vectors. For each , denotes the observed value of . For each , let to indicate that the value of is missing. In either case, the MARFORMER will encode the input fact into a vector .
-
For each attribute , the MARFORMER now constructs a residual stream of vectors . Each in this stream is computed from the entire preceding layer, meaning the collection of representations . The overall architecture is illustrated in Figure 2a. Again we follow the classical Transformer architecture (Figure 2b): attends to all vectors in to compute a residual update, which is added to to yield the transformed representation . The exact formulas are given in equations (14) and (15).
-
For each , the top-layer representation now contains the parameters for the predicted conditional marginal . If , this distribution should simply place high probability on the original observation . Otherwise it should accurately predict the missing value.
Hyperparameters of the MARFORMER include the number of dimensions d and the number of layers L, as well as others described below. The training objective and optimization algorithm also have hyperparameters ( 3.2), as does the masking mechanism ( 2.5).
Parametric marginal distributions. To create a MARFORMER, one must also specify the type of each random variable . A type can be reused across many attributes . A type specifies
• a domain D, which is shared by all random variables of type ;
-
a parametric family of probability distributions over , parameterized by for some ;
-
a layer-0 encoding function , such that when , the distribution places most of its mass on the value if , or is essentially uniform if ;
• optionally, a loss function that can be used to extract point predictions via equation (1).
The type has a learnable embedding , which is included in the MARFORMER's parameters . To distinguish among multiple attributes of type , each such attribute also has a learnable embedding .
One would have to run MCMC without the test inputs to obtain samples of the generative model parameters, and then for each sample, run MCMC again with the test inputs given and the parameters frozen to obtain samples of the test outputs.
If the MARFORMER uses only a single type as in Domains 1–2 below, we fix its embedding to 0 without loss of generality.
Fix and suppose , the type that was just described. (For example, denotes its parameter dimensionality.) Then the layer-0 encoding of the input fact is constructed as the concatenation
The bit indicates whether is missing, and the subvector represents its value . Which variable is being bound to this value? That question is answered by the subvector , which serves as an embedding of , precisely analogous to a learned positional embedding when encoding text (Gehring et al., 2017; Vaswani et al., 2017). Notice that the position dimensions are kept separate from the value dimensions, because the value dimensions are meant to be directly interpretable as parameters without any unembedding function (this seems to work better in practice).
In general, for each layer , again let represent the final elements of . We regard this as specifying parameters for to yield a distribution over the value of . At the final layer , the MARFORMER returns the distribution over as its output marginal , for every .
For an observed attribute , we expect that the residual stream will preserve the observed value, so . For a missing attribute , we expect that as increases, the distribution will gradually sharpen from the uniform distribution at the input layer to a useful predictive distribution at the output layer (as bears out empirically). The training objective (19) will encourage both of these behaviors.
Constructing the residual stream. At each layer , each attribute has a single residual stream . The token representations are updated by a standard pre-norm Transformer block (Vaswani et al., 2017), consisting of multi-head self-attention followed by a ReLU feedforward module:
\mathbf{h}_{i}^{\prime}^{(\ell)}=\mathbf{h}_{i}^{(\ell-1)}+\mathrm{Attention}\Big(\mathrm{LayerNorm}(\mathbf{h}^{(\ell-1)})\Big)_{i} \tag{14} \mathbf{h}_{i}^{(\ell)}=\mathbf{h}_{i}^{\prime}^{(\ell)}+\mathrm{FeedForward}\Big(\mathrm{LayerNorm}(\mathbf{h}_{i}^{\prime}^{(\ell)})\Big) \tag{15}Layer normalization is applied to the full token representation, including its parameter subvector. Attention combines information across attributes, while the feedforward module acts separately on each attribute. Each sublayer adds its output to its input through the residual connection shown above. The resulting is passed directly to the next layer. The feature and parameter dimensions are subvectors of this single residual stream, and both can be updated by each sublayer. At the final layer, the predicted parameters are read directly from the final dimensions of .
Each layer has its own attention, feedforward, and layer-normalization parameters. Hyperparameters include the number and dimensionality of attention heads, and the number and dimensionality of intermediate layers in the feedforward network. The attention operator uses the standard multi-head procedure, with the optional relational modification described next.
Relational attention. Sometimes one needs to predict an attribute i that was rarely or never observed. For example, the annotation task below (§6) has only a single instance with thousands of attributes i. Each variable is observed at most once in this single instance—and the missing variables that we need to predict at test time were observed zero times. How do we generalize to from other variables that we predicted during masked training? Clearly there was not enough training data to learn a useful attribute embedding .
In the annotation task, represents a judge's rating of an item, so might be a structure like {item: doc53, judge: alice, criterion: humor} that describes the annotation request. A reasonable first idea is to construct compositionally. We could augment the MARFORMER with a neural network that encodes the structure into a vector , so that related structures have related encodings. However, that would require designing this encoder. The approach might also fail. We would like the model to learn that alice and bob's ratings of the same document are correlated, but it may be difficult to determine whether and encode ratings of the same document: the reason is that if doc53 and doc54 both appear only in test data, then the encoding network will not have had an opportunity to learn distinct parameters for them.
Instead, we provide a relational attention mechanism. When creating a MARFORMER, one may optionally specify relationships of the form among the attributes, where and denotes the type of relation. Following Shaw et al. (2018, §3.1), we modify the attention mechanism so that can learn to attend specifically to the attributes such that . Its residual stream can extract information from their residual streams.
For the annotation experiments, we use learned relational key and value embeddings, following Shaw et al. (2018, §3.1) and extending its formulation to multiple relational types. Let be the set of relation types linking i to j. For attention head h, the score and output are
Here is the head dimension, and the query, key and value vectors are learned linear functions of the normalized residual streams. Each head uses its own slice of the relation embeddings and ; multiple relations between two tokens contribute additively. The key term modifies attention weights, while the value term supplies relation-specific information to the output. These are learned embeddings rather than fixed relation indicators. The key modification alone is not a claim of greater expressiveness than a linear relation readout; the value modification also changes the information aggregated by attention.
Relational attention allows prediction by analogy. To predict at test time—even if it was never predicted at training time—the MARFORMER will know to consult if the supervised training examples taught it to predict attributes by consulting the variables such that . For example, if connects pairs of ratings on the same document, then the MARFORMER may have learned that such ratings are positively correlated.
Relational attention to and from entities. Relational attention also allows the MARFORMER to build up representations in its residual stream, without the use of a separate encoder. In the annotation example, one can encode the structural description of through relations like and . This requires the entities such as alice and doc53 to be added as new attributes with their own residual streams. Technically, an entity is simply an attribute whose domain consists of a single dummy value (which is considered to be observed and is never masked, i.e., ). Predicting this value is trivial, so the entity's residual stream contains no parameters (). Instead the residual stream serves solely to build up a useful representation of the entity. For example, doc53's representation might indicate that it is highly rated by children but adult judges have a wider range of opinions. Constructing a good representation of doc53 (at lower layers of the MARFORMER) lets attributes such as usefully attend to doc53 (at higher layers) in order to predict how alice will rate it. Constructing such a representation requires the relation graph to also include inverse relations such as doc53 , so that the residual stream of doc53 can attend to all of its annotations.
Notice that the layer-0 embedding of is determined by the type embedding and the entity embedding . In this example, the type would presumably record that is a document entity (as distinct from a judge entity like alice). If this particular document entity was frequently encountered in training data, then the entity embedding might learn idiosyncratic features of it. If was rarely or never encountered, then , and its residual stream will be built “from scratch” by examining its related attributes (e.g., ratings).
Pruning. When i is very large or infinite, it is possible to reduce computation by omitting some of the residual streams. In general, the streams to retain may depend on the input: the observation and the target attributes i that one wishes to predict. They could be chosen by a policy that has been hand-designed or trained to achieve a good speed-accuracy tradeoff (Stoyanov & Eisner, 2012; Vieira & Eisner, 2017; Rao
Shaw et al. (2018) gave a general design for relational attention before applying it to relative positions in a sentence.
et al., 2021). The policy should retain residual streams for the target attributes; for all of the observed attributes that might provide relevant information about them; and for any latent attributes that might also provide relevant information if reconstructed.

(a) Full architecture. Variable tokens (left, N per instance) carry attribute observations; entity tokens (right) carry relational identity. Parameter distributions are read from variable tokens at layer L. Not all inter-layer connections are shown.

(b) Transformer block internals (left) and relational attention graph (right), illustrated for the annotation domain. Dashed red = parent edges; dashed green = sibling edges.
Figure 2: MARFORMER architecture. The annotation domain (items, judges, criteria) is used as the running example, but the architecture supports any typed entity structure.
3.2 Marformer Training
Training the parameters was sketched in §2.5. In practice, we augment (11) with a copy regularizer and parameter regularization. Writing the latter as an penalty gives the following objective, with coefficients and :
Regularization. The optional regularizer penalizes large parameter norms. In the annotation experiments, we instead use the decoupled weight decay of the standard AdamW optimizer.
The copy regularizer says that the MARFORMER should correctly predict observed values, not just masked values. BERT (Devlin et al., 2019) includes this trivial task to ensure that an observed word token's encoding retains information about the word's identity. Similarly, our equation (19) trains the residual stream for attribute i to provide a conditional distribution over regardless of whether was observed in the input or merely inferred from it. This homogeneous representation means that other residual streams have a standard location from which to obtain information about .
Potentially, one could also regularize through deep supervision (Lee et al., 2014; Al-Rfou et al., 2018). Recall that in equation (19) makes use of marginal distributions from the top layer of the MARFORMER. Deep supervision asks to also do well on this objective when is used instead, for lower layers . E shows that learned probes can recover useful predictions from intermediate layers, although the raw parameter
Presumably, the MARFORMER can learn very early in training to satisfy the copy regularizer, as this only requires retaining the observation (for ) by preserving the layer-0 parameters throughout the residual stream: . The residual streams of correlated variables will then learn to attend to —initially to retrieve when , but then more generally to inspect layer 's predictive distribution over regardless of whether .
readout still benefits substantially from the final layers. Whether deep supervision improves training remains an open question.
Optimization algorithm. We optimize the conditional log-loss and copy term in equation (19) using AdamW (Loshchilov & Hutter, 2017). In the annotation experiments, regularization uses decoupled weight decay of 0.01.
Validation and early stopping. As usual, early stopping on a validation set is one way to prevent overfitting to the training examples. In our experiments, we found that this was only necessary in Domain 3 (§6), and we describe there how we carve off the validation set for that domain (§6.3).
Dropout. We use one more regularization trick, inspired roughly by Srivastava et al. (2014). Recall that each attribute i has an embedding . If the number of distinct attributes grows unboundedly with the size of Train, so does the number of parameters—making the MARFORMER nonparametric and at risk of overfitting. Specifically, attributes that are common in training data can overcome the regularizer to learn useful idiosyncratic embeddings. Their very usefulness may sap the MARFORMER's incentive to learn to handle uncommon attributes that lack such embeddings, such as entities that may be important in test data but appear rarely or never in training data. Smith et al. (2005) call this kind of problem weight undertraining.
Thus, for each attribute type , we define a dropout rate for omitting the attribute-specific embedding during training. On such an update, prediction relies on the type embedding and relational evidence rather than the identity-specific deviation. In the annotation experiments, entity deviations are initialized to , while type embeddings are initialized from . An entity whose deviation has never been trained is therefore represented by its type and relations. We use a fixed entity-dropout rate of 0.7 on the generalized axis and 0 on the other axis. This heuristic is shared by the synthetic and real annotation experiments. This encourages the model to use relational evidence even for entities encountered during training.
4 Domain 1: Graphical Models
(a) Complete-data distribution
P*(Y)

Binary variables with logistic conditional probabilities
(b) MCAR missingness

Blue: observed White: missing
Figure 3: Illustration of the complete-data distribution and MCAR missingness in Domain 1, using a four-variable example. (a) A Bayesian network over binary variables, with logistic conditional probabilities at each node. (b) An incomplete instance under MCAR: the observed index set is independent of the complete data. Blue nodes show observed values; white nodes are missing. The variables labeled in the figure correspond to in the text. The experiments use randomly generated networks with 10 variables.
To study the capabilities of the MARFORMER, we will evaluate its performance in three synthetic domains—all MCAR, but with different qualitative properties. In a synthetic domain, the data are generated from a known distribution . This facilitates controlled evaluation:
• We know the complete test-time instances x. Hence we can evaluate test-time log-loss and measure calibration.
• We know the true conditional marginals . Hence we can measure their divergence from the conditional marginals predicted by .
• We know how was constructed. Hence we can compare to classical methods for estimating , in their favorable setting when they are estimating the parameters of the correct distribution family, with full knowledge of the prior from which those parameters were drawn to obtain .
In this first section, is a Bayesian network (BN). The challenge here for the MARFORMER is to predict missing variables without knowing the conditional independence structure (Figure 3). In contrast, the classical methods do know that structure. The full domain specification is in Algorithm 1.
4.1 True Generative Distribution
The sample space has 10 binary attributes where . The complete-data distribution is given by a Bayesian network with known parameters . The structure of the distribution is specified by a directed acyclic graph (DAG) with vertices , and the conditional probability table (CPT) for each has the form of a logistic regression model:
where denotes the set of parents of node in , and is the parameter vector (part of ) for the conditional distribution of given the values of just those parents.
Selecting a particular distribution. To generate the structure of —the DAG —we include the edge (for ) with independent probability . We take . Thus, each of has all previous variables as parents, and each of has an expected 5 of the previous variables as parents.
We then draw the parameters i.i.d. from . These logistic regression parameters consist of one bias term per vertex plus one weight per edge, for a total of parameters.
MCAR missingness mechanism. Our missingness mechanism reveals each variable with i.i.d. probability of 1/2, in both training and test instances. We use this mechanism to produce both training and test instances in all experiments. Because it is MCAR, it is ignorable for all methods.
Inference under the true model. In our experiments, we compare the models' predictions on test examples to the true conditional marginal distributions , which we compute with an exact variable elimination algorithm (Madsen & Jensen, 1999).
4.2 Datasets
We follow the experimental design in §2.5. Given :
• We generate the Test dataset by drawing test instances i.i.d. from .
- The corresponding Train dataset consists of incomplete training instances drawn i.i.d. from the same . Our experiments in this domain are non-transductive, so Train does not include the Test instances. We experiment with Train datasets of different sizes
{10, 250, 500, 750, 1000, 1250, 1500, 1750, 2000}. Each Train dataset is a superset of the preceding one, for better comparability across sizes, but its model is trained independently.
We use these datasets to train and test the MARFORMER and also the full joint model .
We repeat our experiments 10 times, selecting a different distribution each time. This allows us to display 95% bootstrap confidence intervals for all lines on our graphs.
4.3 Marformer Configuration
In the terms of §3.1, we create random variables for 10 attributes , all with the same boolean type , whose distribution family over is parameterized by a single log-odds ratio (logit) , so that and . The input encoding uses three-dimensional vectors: , , and , where the first coordinate indicates missingness. We use no relational edges among the 10 attributes, but each attribute has its own learnable embedding .
We compare three MARFORMER variants to assess architectural scaling: Tiny (L = 2 layers, d = 32 dimensions), Small (L = 4, d = 64), and Large (L = 6, d = 128). The Tiny, Small, and Large variants use 2, 4, and 8 attention heads, respectively.
To stochastically create training examples from an instance in Train, we use a simple masking mechanism ( ) that masks each observed variable with independent 0.15 probability. We train each MARFORMER as described in to obtain a parameter estimate . We use AdamW with weight_decay=0.01. Since all test attributes will be very familiar from training data, we do not use dropout, setting .
Each epoch is one shuffled pass over Train in minibatches of 32. We clip gradients to a maximum norm of 1.0 and use ReduceLROnPlateau to halve the learning rate after 22 epochs without improvement in validation loss.
We run AdamW with learning rate 0.0001 for up to 100 epochs, diagnosing early convergence when all of the 10 most recent epochs failed to decrease training loss by at least 0.1%.

(a) Domain 1 (BN)
(b) Domain 2 (Gaussian)
Figure 4: Learning curves for Domains 1 and 2, showing KL divergence of the true marginals from the predicted marginals (equation (10)), averaged over 10 distributions . Shaded regions show 95% bootstrap confidence intervals. In Domain 1, the KL divergences are so small that they are displayed on a log scale. For measuring KL, the true probabilities are computed exactly in Domain 1, but are estimated in Domain 2 using Monte Carlo integration. That is why in Domain 2, the KL divergence between two copies of the true model is measured as slightly positive rather than zero (horizontal green line): the estimated probabilities are slightly different in the two copies.

(a) Domain 1

(b) Domain 2
Figure 5: Horizontal axis: Cross-entropy achieved by the estimated joint model (MAP-EM in Domain 1, §4.4; direct MAP optimization in Domain 2, §5.4). Vertical axis: Cross-entropy achieved by the estimated MARFORMER. Different rows evaluate different MARFORMER sizes; different columns evaluate different sizes. Each point corresponds to a single marginal prediction on a test instance with , color-coded by the entropy of the true marginal distribution (aleatoric uncertainty). Points below the diagonal are predictions on which MARFORMER is more accurate than the joint model. Brighter points have higher entropy, due to less informative conditions , so they tend to have higher cross-entropy under both models. All graphs for the same domain use the same true generative distribution .
4.4 Joint Model Estimation
We compare to the classical approach of fitting a joint model of all the variables . Joint modeling is given the true model family (which includes ) and only needs to estimate . Specifically, joint modeling knows the true DAG and the logistic regression parameterization of its CPTs—as well as the true prior over . The MARFORMER knows none of this.
As discussed in §1, we use the MAP-EM algorithm, which finds a parameter estimate that locally maximizes equation (12). We halt when the objective changes by less than 0.1%, similar to the MARFORMER. MAP-EM is sensitive to initialization because the objective is non-convex. Thus, we allow 10 random restarts and take the that achieves the best value of (12).
We then make exact marginal predictions from , and compare them to the true marginals from .
4.5 Experimental Results
Aggregate results are shown in Figure 4a. Larger MARFORMERS reliably achieve lower KL divergence, which continues to decrease as increases. Traditional joint modeling does worse than all but the Tiny MARFORMER, despite its knowledge of the true model family and prior. Given that we use exact inference, the reason is presumably that MAP-EM suffers from the local maximum problem, as can be seen from the fact that 10 random restarts improves its average KL divergence to the truth. Even with 10 random restarts, it presumably does not find the actual MAP estimate of .
Figure 5a breaks down these KL divergences at three specific training sizes. We saw in Figure 4a that with only 10 training instances, neither approach is clearly better, but Figure 5a (column 1) further shows that they make different errors—the two methods can predict quite different probability distributions—and that there is a minority of outlier cases where the MARFORMER predictions are quite wrong. By 1010 training instances (column 2), when both methods achieve low KL (Figure 4a), the Large MARFORMER is more accurate than the joint model at most predictions. By 2000 training instances (column 3), the Small MARFORMER is as well.
Variant. Recall that the naive masking method of this paper is valid only when the training instances are MCAR ( ). Out of curiosity, we also try the naive method in a setting that is MAR but not MCAR, even though the masked training examples will be biased, and find qualitatively similar results ( ).
4.6 Runtime

(a) Training Time: Domain 1

(b) Training Time: Domain 2
Figure 6: Training time (wall-clock seconds) on Domains 1 and 2 is essentially proportional to the training set size. Even for these small problems, MARFORMER is substantially faster to train. It is also faster at test time (not shown here), since inference requires only a single forward pass per test instance.
The classical approach of §4.4 is not always practical. Extracting the marginal distributions from , as well as performing the E step of MAP-EM, must marginalize over the missing variables given . This task is computationally intractable except for low-treewidth BNs (Cooper, 1990; Chandrasekaran et al., 2008). We were able to run these experiments only because the BNs are quite small.
Figure 6a shows that MAP-EM is slower than MARFORMER training even for these small Bayesian networks G, due to its need for random restarts. Furthermore, the runtime of known MAP-EM algorithms will blow up exponentially as G grows, since at the E-step they must solve the #P-complete problem of marginal inference (Roth, 1996). In practice, large BNs would be treated instead with approximate inference algorithms—introducing errors beyond those shown in Figure 4a.
The MARFORMER is a fast feed-forward computation that can be trained to approximate marginal inference in BNs or other graphical models, as we originally proposed in Stoyanov et al. (2011). Its runtime grows only quadratically with G. Previously, Stuhlmüller et al. (2013) and Walecki et al. (2019) also proposed training a single feed-forward network to predict many conditional marginals. However, those papers were attempting to amortize inference in a known model: they assumed that complete training instances could be sampled from , whereas we aim to train on naturally occurring incomplete instances without access to . They also did not use our Transformer architecture, which allows cross-attention among unboundedly many random variables (see §E and §6).
We caution that neither MAP-EM with approximate inference (using traditional polytime algorithms), nor the MARFORMER's amortized approximate inference (using a polynomial-sized neural network), can come
The problem is only with training (and specifically the naive method), not with testing. A properly trained MARFORMER can directly predict missing values on test instances that are MAR ( ).
For sufficiently large training samples, the existing errors can be attributed to the fact that even exact MAP-EM is only an approximation to MAP—it finds a local optimum and not necessarily the true MAP estimate.
with any worst-case guarantees when is a BN, since marginal inference on general BNs is inapproximable (Roth, 1996).
5 Domain 2: Discretized Multivariate Gaussians

Figure 7: Domain 2 begins with a joint Gaussian distribution over latent continuous variables (left), and discretizes their values into fixed but irregular bins, yielding a joint distribution over observable discrete variables (right). The positive correlation of carries over to , but the probabilities in the grid at right are also affected by the bin widths. Our experiments use 10 variables of each type, not 2 as illustrated here.
The next domain is governed by correlated continuous random variables, which are discretized into ordinal ratings (Figure 7). This is a multivariate ordered probit model (not conditioned on any other regressors). Similar models are widely used for multidimensional graded (i.e., ordinal) responses in psychometrics.
The underlying continuous variables are never observed. The classical baseline method ( ) knows the entire mechanism: it explicitly reconstructs the latent values of the continuous variables and estimates their covariances and the discretization thresholds (Bock & Aitkin, 1981). In contrast, our MARFORMER configuration ( ) does not explicitly model the continuous variables, and does not even know the order of the discrete categories (e.g., that a 2 rating falls between 1 and 3 ratings). The MARFORMER must discover the underlying ordinal and correlational structure, despite the irregular discretization and the fact that some of the discrete values are missing.
5.1 True Generative Distribution
The sample space has 10 attributes where . The complete-data distribution is given by a model with a latent variable and known parameters :
where is a multivariate normal distribution , and each threshold vector has elements . This construction of is illustrated in Figure 7.
We construct the threshold vectors from underlying parameters . Note that the marginal distribution of is . To partition it into roughly equal bins, we take to be a roughly uniform distribution over and set where is the standard normal CDF.
Thus, the model parameters specify the positive definite covariance matrix and the distributions .
Selecting a particular distribution. To choose , we sample , taking . How about ? To impose a substantive conditional independence structure (as in §4), we make sparse, corresponding to a simple path or cycle on the 10 variables. For example, the path case yields a tridiagonal . The joint modeling method is given the true sparsity pattern. The MARFORMER is not—it is not even told that there is a covariance matrix.
Specifically, we flip a fair coin to choose between the two sparsity patterns (path and cycle). We would then like to draw the symmetric positive definite from the Wishart prior , with scale matrix and degrees of freedom , conditioned on this sparsity pattern. For computational convenience, we impose the sparsity constraint only softly, downweighting the Wishart prior probability of by . We take for entries that are supposed to be 0 and otherwise. The mean absolute value of the entries intended to be zero is 0.0181. We sample from this modified prior via Metropolis-Hastings (Robert, 2016). We initialize the chain at an unconstrained draw from the Wishart prior, and use the proposal , where has i.i.d. entries. Proposals that are not positive definite (checked via a Cholesky decomposition) are rejected outright; remaining proposals are accepted with the usual Metropolis probability under the penalized log-density above.
MCAR missingness mechanism. We apply the same simple mechanism as in §4.1.
Inference under the true model. To evaluate the accuracy of our models' predictions, we compare to the true conditional marginal distributions , which we estimate using Gibbs sampling with a burn-in period of 250 and sample size 1000.
5.2 Datasets
We generate 100 instances for Test. Similar to §4.2, each Train dataset consists of incomplete training instances, with .
We repeat our experiments 10 times, selecting a different distribution each time.
5.3 Marformer Configuration
We use the same set of hyperparameters, training procedures, and metrics as in §4.3. The one difference is that our variables are no longer boolean, but range over . We give them all the same type , which is parameterized by a logit vector , so that . Its encoding function maps , , , etc.
5.4 Joint Model Estimation
We train a MAP model as a domain-specific baseline to maximize the observed data likelihood plus prior probabilities of , p. The domain model is parameterized by a Cholesky factor matrix L and bin probabilities p, where we use to obtain and directly use p to compute cumulative probability sums and real-valued bin boundaries.
For the parameters’ prior probability, the model uses their prior distributions as defined in §5.1, with a Wishart prior plus soft sparsity constraints for and a Dirichlet prior for p. The likelihood given an observed instance is the probability of a rectangular region in Figure 7: a single row, column or cell, depending on
A Gaussian distribution can be viewed as an undirected graphical model (Markov random field) over , in which the zero entries of the inverse covariance matrix correspond to missing edges.
To obtain real-valued boundaries, we apply the inverse CDF function to the and multiply the result by .
which variables are observed. To calculate this integral given the current parameters, we implement Genz's algorithm (Genz, 1992). Genz's algorithm reparameterizes the multivariate Gaussian model into independent standard normals using Cholesky factors (transforming the integration domain to a parallelotope), further reparameterizes to transform the integration domain to a unit hypercube (changing the integrand), and then approximates the integral by Monte Carlo sampling from the hypercube. To obtain the gradient of the log-likelihood, we hold the samples fixed and use PyTorch to backpropagate through the reparameterization to the parameters.
We use stochastic gradient ascent to locally maximize the MAP objective equation (12), specifically using the AdamW optimizer with learning rate 0.01, until convergence ( ). Again we allow 10 random restarts. We then use Gibbs sampling as in §5.1 to predict missing values on the test instances. To verify our implementation, we also try initializing training at the ground-truth parameters .
5.5 Experimental Results
Figure 4b shows our main experimental results. With enough training data, all MARFORMER variants achieve significantly lower KL divergence than a joint model trained with MAP, particularly when the MARFORMER is large. With less training data, the MAP approach outperforms MARFORMER due to its incorporation of more domain knowledge. MAP again seems to get stuck in a local optimum, as demonstrated by the fact that it does much better when initialized with ground-truth parameters.
Per-prediction cross-entropy scatterplots in Figure 5b confirm that with enough training data, the MAR-FORMER—particularly when large—achieves lower cross-entropy than the joint model for the majority of marginal predictions, particularly on the lower-entropy marginals where there is a clearer right answer.
Variant. As in §4.5, running on MAR data gets qualitatively similar results (§A).
6 Annotation as a Domain
Annotation workflows exemplify the full challenge of conditional marginal prediction in a structured setting. A dataset of items must be evaluated by multiple judges on multiple criteria, but collecting every judge's ratings of every item would be prohibitively expensive. This section evaluates the MARFORMER in this setting.
6.1 True Generative Distribution
An annotation dataset involves I items. J judges, and K evaluation criteria.
We extend the variable indices introduced in §2.1 to allow structured variable names, where an index may itself be a tuple. In this domain, , where each indexes a rating variable with . That variable is the Likert score assigned to item by judge on criterion .
The complete rating collection X forms a complete instance, which can equivalently be viewed as a tensor in . In practice only a sparse subset of entries is observed, since collecting every annotation is prohibitively expensive.
This is naturally framed as 3D matrix completion (Candes & Recht, 2012; Keshavan et al., 2009). Classical collaborative filtering recovers a 2D user-item rating matrix. The additional criterion axis here introduces
Ground-truth initialization typically finds an estimate close to —perhaps even better than using infinite restarts to get the exact MAP estimate.
The question of which annotations to collect next—and when enough have been gathered—is precisely the active feature acquisition problem discussed in §2.2. At each step, one can collect the annotation with the highest VOI, and stop when further annotation would not reduce expected loss enough to justify the cost. Computing the VOI requires a model that produces calibrated marginals over all missing annotations, given the annotations observed so far.
richer dependencies among ratings: for a fixed pair, ratings across criteria are jointly distributed, and for a fixed , ratings from different judges may exhibit systematic dependence.
The complete-data distribution belongs to a latent-variable model family that we call the Compositional Projection Model (CPM). Recall that , where denotes the rating variable indexed by and . The CPM encodes three structural assumptions about annotation data: items can be represented in a latent semantic space, criteria correspond to different directions of evaluation in that space, and judges exhibit systematic but partially shared preferences.
Each item has a latent embedding . Rather than assigning every judge an unrelated parameter vector for every criterion, the CPM represents each judge as a mixture over latent judge prototypes.
For criterion k and prototype t, the prototype-conditioned preference vector is
where is the sigmoid function applied elementwise.
The three terms separate shared criterion effects, shared judge-prototype effects, and criterion-prototype interactions. The vectors represent, respectively, the direction associated with criterion , the general style of judgment associated with prototype , and the deviation of prototype on criterion .
Each judge has mixture weights over the judge prototypes. The effective preference vector for judge on criterion is
Given the item embedding , the latent score for is
Thus, the score increases when the item embedding is aligned with the judge's criterion-specific preference direction.
Selecting a particular distribution. To choose the particular parameters that define , we sample the CPM parameters from an upper-level distribution. We use latent dimension and judge prototypes. Each item embedding is sampled as
and the vectors , , and are sampled from zero-mean Gaussian distributions. The interaction term is sampled at a smaller scale than the prototype term , so that judge prototypes retain shared structure across criteria while still allowing criterion-specific variation. The corresponding scale parameters are drawn from half-normal distributions. Judge mixture weights are sampled as
We set the hyperparameters of these upper-level distributions to posterior means obtained by fitting the CPM to LLM-Rubric data described in §7.1; the resulting numerical values are given in Table 1. The remaining parameters used to select are introduced below.
The observed variable is generated from the latent score using a random-threshold ordinal model. For each judge–criterion pair , the CPM draws
Real annotation settings add a further challenge: new items may be added to a collection or new judges may join mid-study, requiring the model to generalize to entities unseen during training.
We initially experimented with and softplus( ) nonlinearities, but these produced more difficult posterior geometries and poorer HMC mixing. We therefore use the sigmoid nonlinearity, which bounds the preference coordinates and led to more stable inference in our Stan implementation. This was not an issue for MARFORMER; we use the sigmoid here to keep the comparison to Stan fair.
where . The vector controls how judge uses the rating categories for criterion . Some judges may use high ratings more frequently on a given criterion, while others may use the scale more conservatively. We choose ordinal thresholds so that, marginalizing over item embeddings and measurement noise, the category frequencies for each follow . Since ,
is marginally Gaussian with variance . After adding measurement noise , let
Then is marginally standard normal over random items. We therefore set
Finally,
The CPM is closely related to recent work on pluralistic reward modeling. In particular, Chen et al. (2024) represent each user as a mixture of prototypical users. Their Model B similarly constructs a context-dependent user representation and projects an output representation onto it to obtain a scalar reward. CPM uses this compositional structure for ordinal ratings rather than pairwise rankings: PAL's prompts correspond roughly to our criteria, its users to our judges, and its outputs to our items. More broadly, latent representations of people and alternatives have a long history in models of human judgment; for example, Coombs (1950) used one-dimensional latent positions to explain rankings of opinions by their similarity to a person's own position.
6.2 Dataset Construction and Missingness
We generate synthetic annotation data from the complete-data distribution defined in §6.1. In our experiments, there are up to items, with and .
MCAR missingness mechanism. We first form a sparse annotation design by selecting, independently for each item i, four judges uniformly at random without replacement, with all K criteria represented for each selected item–judge pair. A further MCAR mask partitions ratings in this design into observed context and hidden prediction targets. Ratings outside the design are not scored. Both stages select ratings independently of any values, so the resulting missingness mechanism is MCAR. As discussed in §2.4, this allows the MARFORMER to construct conditionally unbiased training examples by masking observed ratings.
Test data. Rather than evaluating on all missing variables as the number of items grows, we designate a fixed test corner. Let contain items, and let contain judges. The test corner consists of the attributes
The dense test corner contains potential ratings. The sparse annotation design contains 639 of these ratings, covering 71 item–judge pairs on 56 of the 100 test items, with all 9 criteria per pair. Of these 639 ratings, 323 are observed context and 316 are hidden and scored. We evaluate only these 316 targets, keeping the set of test prediction problems fixed as the amount of training data increases.
More specifically, PAL’s user mixture weights correspond to , while its context-dependent prototype representations and output representations play roles analogous to our prototype-conditioned preference vectors and item embeddings , respectively.
Generalization settings. We vary the amount of available data along either the item or judge axis. In item generalization, predictions concern the fixed test items as more training items become available; in judge generalization, the analogous sweep is over judges. Most experiments are transductive: observed ratings of test entities are available during training as context, while their missing target ratings remain hidden. The non-transductive variant, denoted MARFORMER NT, excludes the test entities from training and uses their observed ratings only at prediction time. Test items or judges are therefore new entities in this variant.
The nominal sizes and count all available entities in the transductive setting, including test-block entities with observed context. In the non-transductive setting, they count training entities disjoint from the test block. The same nominal size therefore denotes different training partitions in the two protocols. The sweeps are described in §6.6.
6.3 Marformer Configuration for the Annotation Domain
We instantiate the MARFORMER on the structured index set introduced above. As usual, there is one variable token for each . For , we additionally introduce entity tokens for item , judge , and criterion , with relations
together with their inverse relations as described in §3.1. Between rating variables, we use the relations
when the corresponding components of and are equal. These relations are symmetric and therefore do not require separate inverse relations.
In the terms of §3.1, all rating variables have the same categorical type , whose distribution family over is parameterized by logits , so that . Its encoding function maps an observed rating to and to . We use . As in §3.1, the parameter stream additionally contains the wildcard bit, giving parameter-stream dimension .
The feature-stream dimension is 75, giving total token dimension . We use Transformer layers, attention heads, and a ReLU feedforward module of width with one hidden layer. Relational attention uses learned key and value embeddings as described in §3.1.
We train with AdamW, learning rate and weight decay 0.01, with standard Transformer dropout 0.1. Each artificial mask selects observed ratings uniformly without replacement, where is the number of observed ratings in the training input. We draw five refreshed masks per epoch. Masked and unmasked observed targets receive loss weights 15 and 1, respectively, corresponding to under equation (19). Naturally missing ratings do not enter the training loss.
For synthetic annotation, we hold out a block containing 15% of the training entities on the generalized axis as the validation set. We search for the epoch budget over 2000 epochs, selecting the minimum of the five-point-smoothed validation-loss curve. We then merge the validation block back, refit on the full training partition for the selected number of epochs, and report the last checkpoint. The validation block is included in the stated training size. The smallest transductive settings have no training entities outside the test block from which to reserve validation data. They use the axis-median selected epoch budgets: 142 epochs at and 126 at . This exception does not apply to the non-transductive models at the same nominal sizes, which have separate training entities and their own validation blocks.
Entity-embedding dropout is 0.7 on the generalized axis and 0 on the other axis. Each forward pass uses at most 500 items during both training and evaluation. This cap stabilizes training and lets us scale to larger datasets within the same GPU memory budget.
6.4 Joint-Model Estimation with Stan
We compare the MARFORMER to a Bayesian joint-model estimator implemented in Stan. The correctly specified baseline is given the true CPM model family from §6.1, together with the same prior families and hyperparameters used to generate . It does not observe the realized parameters , which must instead be inferred from the observed ratings. We refer to this baseline as Stan Oracle: “oracle” means that the model family and priors are correctly specified, not that the true latent parameters are known.
Stan performs posterior inference over the CPM parameters and latent variables using Hamiltonian Monte Carlo (HMC). In particular, it infers the item embeddings, criterion and prototype vectors, criterion–prototype interactions, judge mixture weights, rating-threshold parameters, and global scale parameters from the incomplete annotation tensor. Because the missingness mechanism is MCAR ( ), it is ignorable for this inference.
For each posterior sample , the fitted CPM induces a categorical predictive distribution over the C Likert categories for each missing rating using the ordinal-probit observation model from §6.1. We average these distributions over the M post-warmup HMC samples to approximate the posterior predictive marginal:
The explicit calculation of the category probabilities for each posterior sample is given in §C.1.
Thus, unlike a plug-in MAP estimator, Stan integrates over posterior uncertainty in the latent parameters when predicting a missing rating.
We run Stan with one chain, 300 warmup iterations and 500 post-warmup sampling iterations, adapt_delta=0.85, max_treedepth=12, and random initialization. The sampler configuration is summarized in §C.
Misspecified CPM variants. The correctly specified Stan Oracle gives the joint-model approach privileged knowledge of the data-generating family. To study the effect of model misspecification, we also consider three restricted CPM variants.
Stan Misspec Proj removes judge-specific projection behavior. Rather than assigning each judge j separate mixture weights over the latent prototypes, the model uses a shared prototype mixture across judges. Judges may still differ in how they use the rating scale.
Stan Misspec Bin retains judge-specific projection behavior but removes judge-specific rating thresholds. For each criterion k, all judges share the same ordinal threshold parameters, rather than using a separate calibration for each pair.
Stan Misspec Both applies both restrictions: judges share both their prototype mixture and their criterion-specific rating thresholds. The remaining criterion- and item-level latent structure is unchanged.
6.5 Other Baselines
In addition to the CPM-based Stan models, we compare against three simpler empirical baselines. All three estimate missing ratings directly from the observed annotation tensor, without assuming the latent structure of the CPM.
Pooled Unigram. The Pooled Unigram baseline predicts missing ratings using smoothed empirical conditional frequencies. A pooling rule specifies which tensor indices distinguish the distributions: uses global rating frequencies, while estimates a separate distribution for each criterion-judge pair, pooling across items. The reported baseline uses the latter fixed rule, with Laplace smoothing and backoff to global frequencies for unseen judges. It provides a simple comparison for what can be achieved by pooling ratings along the criterion and judge axes.
Naive Bayes. The Naive Bayes baseline additionally conditions on observed ratings neighboring the target variable. For a missing target and candidate category c, it uses
The first product captures correlations among criteria for the same judge–item pair: each ordered criterion pair has its own conditional distribution . The second captures agreement across judges rating the same criterion–item pair. This factor is shared across judge identities, while judge-specific rating tendencies are represented separately by . All categorical factors are estimated from the training data with smoothing, and the resulting scores are normalized over .
Log-linear model. Finally, we use a discriminatively trained multiclass logistic regression model with features analogous to the factors in Naive Bayes. For each candidate category c, the model includes bias features for the target criterion, judge, and item. It also includes criterion-pair features for observed ratings on other criteria of the same judge-item pair; equivalently, each ordered criterion pair has a learned compatibility table. Cross-judge evidence is represented by a shared compatibility table between an observed rating and the candidate rating c. Contributions from multiple observed neighbors add in log-space. Unlike Naive Bayes, this model makes no conditional-independence assumption: its feature weights are estimated jointly by regularized conditional maximum likelihood.
All three empirical baselines are transductive in our experiments: observed ratings in the test corner may be used when predicting its missing entries. We separately report a non-transductive MARFORMER variant, allowing us to evaluate whether the MARFORMER remains competitive when it is denied this transductive training advantage.
6.6 Experiments and Results
We evaluate conditional marginal prediction under the item- and judge-generalization settings defined in §6.2. In both settings, predictions are evaluated on the missing ratings in the fixed test corner.
Metrics. We evaluate predictive distributions using log-loss and the quality of their induced point predictions using MBR- (Figure 8). For a predicted categorical distribution , the Bayes-optimal prediction under squared error is its conditional mean,
and MBR- measures the resulting squared prediction error. We additionally evaluate probabilistic calibration using smooth expected calibration error (smECE; Figure 9).
Experimental sweep. For item generalization, we vary
At , the available items consist only of the 100 test-corner items. Both Stan and the MARFORMER are evaluated up to to compare their predictions as more data become available.
For judge generalization, we vary
We evaluate the standard transductive MARFORMER and a non-transductive variant, denoted MARFORMER NT, which excludes whole test entities during training.
Empirical baselines are excluded from the main-text figures for clarity; full comparisons appear in §C.
Item Generalization: Test Log Loss (mean ± 0.05 SD)

(a) Log-loss: item generalization
Item Generalization: MBR L2 (mean ± 0.05 SD)

(b) Log-loss: judge generalization

(c) MBR- : item generalization
Annotator Generalization: MBR L2 (mean ± 0.05 SD)

(d) MBR- : judge generalization
Figure 8: Log-loss (a)–(b) and MBR- (c)–(d) on missing ratings in the fixed test corner as the amount of training data increases. Item-generalization results extend to for all models; in judge generalization, MARFORMER NT stops at because test judges are excluded from training. Shaded bands show one bootstrap standard error of the mean, resampling items on the item axis and judges on the judge axis. Full comparisons including the empirical baselines are reported in §C.
Predictive performance. In item generalization, Figure 8(a) shows that log-loss improves overall as more training items become available, while a gap to the correctly specified Stan CPM remains. At , log-loss is 0.683 for the MARFORMER versus 0.600 for Stan. The non-transductive MARFORMER follows a similar overall trend. We do not interpret small differences between individual training-size points as evidence of a systematic advantage for either MARFORMER variant. Stan is given the correct generative model family, whereas the MARFORMER learns the conditional structure from the observed ratings.
The corresponding MBR- results in Figure 8(c) show the same qualitative behavior for point prediction. As the number of training items increases, the conditional means produced by the MARFORMER improve overall, but remain less accurate than those obtained from the correctly specified joint model.
In judge generalization, Figure 8(b)–(d) shows that both the MARFORMER and the correctly specified Stan CPM improve overall as more training judges become available, with the MARFORMER remaining competitive throughout. The comparison with the misspecified Stan variants and empirical baselines is reported in full in §C.
Calibration. Because the goal is conditional marginal prediction, good point-prediction performance alone is insufficient: predicted probabilities should also reflect empirical frequencies. Figure 9 examines calibration at the largest available training sizes. In item generalization at , smECE is 0.020 for the MARFORMER, 0.022 for MARFORMER NT, and 0.025 for the correctly specified Stan CPM. These estimates indicate calibration comparable to the oracle baseline at this training size. At smaller item-training sizes ( ), the MARFORMER has higher smECE than Stan Oracle. The conditional log-loss objective in equation (7) rewards matching conditional distributions on artificially masked observations rather than only their most likely values. The layer-by-layer development of these predictions is examined in §E using logit and tuned lenses: learned readouts recover predictions close to the final model's by layer 3, while the raw parameter coordinates continue to improve through the final layers.
Conditional predictions also support chained sampling and VOI-based acquisition ( 2.2).


(a) Item generalization ( )

(b) Judge generalization ( )
Figure 9: Calibration of predicted categorical probabilities against empirical frequencies at and , the largest training sizes with results for all models shown. Probabilities for all C = 4 Likert categories are pooled in the reliability calculation. The diagonal indicates perfect calibration; the displayed smECE widths are relplot's reported calibration-error widths from 500 bootstrap resamples.
Computational cost. For synthetic annotation, we account for both validation-based epoch selection and the subsequent refit. The reported runs used a 2000-epoch search budget; for runtime accounting, we give a hypothetical cost estimate for ending the search 50 epochs after the selected epoch, then performing the measured refit. For selected epoch , measured full-search time , and measured refit time , the estimate is
This estimate uses the recorded search and refit times and assumes approximately constant cost per epoch and that an earlier stopping rule would reach the selected epoch. A patience-50 rule could instead stop before a later validation minimum; this estimate therefore does not establish the cost of recovering the reported checkpoint. For transductive MARFORMER at , the estimated total is 60.7 minutes (including 27.7 minutes for refitting), compared with about 757 minutes for Stan Oracle, a roughly difference between this hypothetical estimate and the measured Stan cost. At , the corresponding totals are 2.5 and about 52 minutes. On the judge axis, the MARFORMER totals are 1.6 minutes at and 2.9 at 50; Stan takes about 55 minutes at 40. Runtime curves appear in Figure 16.
7 Applying Marformer to Real Annotation Data
Real annotation datasets differ from the synthetic setting in two important ways. Missingness follows a structured study-design protocol rather than the i.i.d. Bernoulli mechanism of Domains 1–2. Applying the masking justification requires the additional assumption that the retained human ratings are MCAR; we do not verify this assumption from the processed data. Second, there is no known ground-truth generative distribution and hence no oracle model for comparison. We evaluate in a fully transductive setting and focus on generalization across items, with the full judge set fixed throughout.
Real annotation datasets also motivate a broader use of conditional marginal prediction: using abundant, inexpensive measurements to predict the outcomes of measurements that are costly to obtain. Here, for example, LLM ratings can be collected much more cheaply and densely than human ratings, so that observed LLM ratings may help predict the human ratings that were not collected. The same pattern appears in other domains. DataDecide (Magnusson et al., 2025), for example, studies whether inexpensive small-scale language-model training experiments can predict which pretraining choices will perform best at much more expensive scales. Sim-to-real methods similarly exploit inexpensive simulated experience to reduce the amount of costly real-world data required to train or evaluate robotic systems (Zhao et al.,
Random judge assignment would support MCAR if assignment and subsequent retention were independent of rating values. The sparse pattern alone does not establish this independence.
(2020). Omnimodal Encoders (Harwath et al., 2026) consider an analogous problem in multimodal modeling: developing inexpensive intrinsic evaluations of encoders that predict their downstream performance after integration into a full multimodal model, without requiring every candidate encoder to be evaluated by training the full system. In each case, inexpensive observations are valuable insofar as they provide information about the outcomes of more expensive experiments; conditional marginal prediction provides a natural way to represent both the prediction and the remaining uncertainty.
The predicted marginals can also be propagated into approximate uncertainty about downstream population statistics. For example, suppose we wish to estimate the difference in mean human rating between two populations of items when some human ratings are missing. We can repeatedly impute missing ratings by chaining their predicted conditional marginals (equation (2)) and recompute the population difference, obtaining a distribution over the difference that reflects uncertainty about the unobserved ratings.
In addition to the Stan CPM and empirical baselines described in §6.4 and §6.5, we compare against two neural imputation methods adapted for categorical prediction. MIWAE (Mattei & Frellsen, 2019) trains a deep generative model via an importance-weighted ELBO over incomplete observations; we replace its reconstruction head with C-dimensional logits to produce Likert distributions. ReMasker (Du et al., 2023) applies masked autoencoding to tabular data, iteratively re-masking observed entries and training a Transformer to reconstruct them; we similarly adapt its output head to produce C logits. Both methods treat the data as a flat table without the entity-structured relational attention used by MARFORMER.
The Stan CPM baseline is fit here with weakly informative priors, allowing the observed data to determine the posterior rather than calibrating the priors to a known data-generating distribution as in the synthetic experiments.
7.1 LLM-Rubric
Multi-judge datasets have been used to study subjective judgments in NLP, including disagreement among human judges (Chhun et al., 2022). We focus on LLM-Rubric (Hashemi et al., 2024), which combines sparse human judgments with dense LLM judgments on the same items. The dataset contains 225 conversations from a human–AI information-seeking task, each evaluated on rubric dimensions, including naturalness, conciseness, and citation quality. Our annotation tensor includes judges: 24 human judges and one LLM judge (GPT-4o-mini). Ratings use a Likert scale; human ratings are hard labels, while the LLM provides a probability distribution over the four categories. Conversations have ratings from up to 3 of the 24 human judges and from the LLM. The human annotation tensor is therefore approximately dense per criterion, while the LLM slice is fully observed. We use a 175/25/25 train/validation/test split over conversations and follow the item-generalization protocol of §6.2, varying .
For the 25 test conversations, we hide and score all 666 collected human ratings: 74 conversation-judge pairs across all 9 criteria. Of these conversations, 24 have ratings from three human judges and one has ratings from two. The 225 LLM rating distributions remain visible as context and are not evaluation targets. Uncollected human ratings are not scored. No human rating from a test conversation is available as input or as a training target. In transductive training, test conversations enter the graph only through their LLM ratings; human supervision comes from the training split. The same test targets and observed context are used for all evaluated methods.
Marformer Configuration We use the architecture and optimization hyperparameters described in §6.3, with item-embedding dropout and the following domain-specific details. For LLM ratings, the encoding function receives the full categorical distribution in place of a one-hot human rating, allowing the dense LLM slice to enter the graph as soft evidence. We train for 300 epochs and select the checkpoint with
Unlike the CPM, MARFORMER requires no prior specification. The posterior scale hyperparameters inferred by Stan CPM from the real data are reported in §D. These posterior estimates also informed the scale choices used to construct the synthetic CPM in §6.1, grounding the controlled synthetic evaluation in magnitudes observed on real annotation data.
This sparsity pattern is characteristic of annotation studies in which LLM judgments are cheaper to obtain than human judgments. Because LLM judgments may be biased, an imputation method should produce predictions that are calibrated against human judgments.
the lowest loss on the 25-conversation validation split, retaining that checkpoint without refitting. Each forward pass is restricted to 10 items during both training and evaluation.
The architecture accepts any subset of human and LLM ratings as context. The training masking mechanism determines which conditional prediction tasks receive supervision ( ). Structured masks can therefore target particular groups of ratings—for example, human ratings conditioned on LLM ratings—while using the same architecture. As with other masking schemes, their statistical justification depends on the missingness assumptions described in .
LLMRubric Item Generalization: Test Log Loss (mean +/- 0.05 SD)

(a) Log-Loss
LLMRubric Item Generalization: MBR L2 (mean +/- 0.05 SD)

(b) MBR-L2
Figure 10: Log-loss (a) and MBR-L2 (b) on the LLMRubric test set as a function of training items. Stan CPM is run with the HMC configuration described in §C. Bands are bootstrap standard errors of the mean, obtained by resampling conversations conditional on the fitted model and observed data realization. Runtime curves appear in §D.




(a)
(b)
Figure 11: Calibration plots (predicted probability vs. empirical frequency) on LLMRubric at full and minimal training size. At , MARFORMER is well-calibrated; at , calibration degrades for all methods, with MIWAE and ReMasker exhibiting overconfident predictions at the scale extremes.
Figure 10(a) shows log-loss as a function of training size. At , Stan CPM (1.39) and Pooled Unigram (1.38) lead MARFORMER (1.95). At , MARFORMER has lower log-loss: 1.12 against 1.20 for Stan CPM. The MARFORMER improves overall, though non-monotonically, reaching 1.007 at versus 1.093 for Stan CPM and 1.112 for Pooled Unigram. Unlike the synthetic setting, Stan CPM here has no privileged access to the correct generative family, and its early-data advantage is reversed at the largest training size. Figure 10(b) also favors MARFORMER on MBR-L2 at : 0.59 versus 0.78 for Stan CPM. Figure 11 shows calibration at representative training sizes: at , MARFORMER is well-calibrated; at , it is less well-calibrated than Stan CPM. The recorded real-data training times at are approximately 22 minutes for MARFORMER and 162 minutes for Stan CPM. The MARFORMER timing includes the 300-epoch training run and best-validation checkpoint selection, without refitting. Runtime curves appear in §D.
8 Other Related Work
Classical and generative methods. Early work on imputation is largely statistical or generative in nature. Classical approaches include multiple imputation by chained equations (MICE) (Buuren & Groothuis-Oudshoorn, 2011), nuclear-norm matrix completion (SOFTIMPUTE) (Mazumder et al., 2010), and nonparametric methods such as random-forest imputation (MISSFOREST) (Stekhoven & Bühlmann, 2011). These remain widely used but often require model selection per dataset and struggle with heterogeneous data. Generative models attempt to overcome these limitations by modeling the joint distribution of features: GAIN (Yoon et al., 2018) and MisGAN (Li et al., 2019) rely on adversarial training, while HI-VAE (Nazabal et al., 2018), VAEAC (Ivanov et al., 2019), and MIWAE (Mattei & Frellsen, 2019) provide likelihood-based training and probabilistic imputations, with extensions for MNAR data in the case of Ipsen et al. (2020). These methods model distributions over missing values, while our work focuses on individual conditional marginals, which are directly aligned with downstream decision tasks.
Transformers for tabular modeling. The success of the Transformer architecture (Vaswani et al., 2017) has motivated its application to tabular data. TABTRANSFORMER (Huang et al., 2020), FT-TRANSFORMER (Gorishniy et al., 2021), and SAINT (Somepalli et al., 2021) demonstrate that attention-based tokenization can outperform classical learners on supervised tasks. More recently, these architectures have been adapted for imputation. NAIM (Caruso et al., 2024) introduces feature-specific embeddings with masked self-attention to model conditional structure, while UNMASKING TREES (McCarter, 2025) offers a competitive non-neural alternative via gradient-boosted “unmasking” steps. Our approach differs in that we work with structured variable names encoded through compositional entity embeddings, and evaluate on synthetic datasets with known distributions.
Masked Autoencoding. Masked autoencoding (MAE) (He et al., 2021) has emerged as a powerful self-supervised training signal across domains, and its adaptation to imputation is natural. REMASKER (Du et al., 2023) extends MAE to tabular data by repeatedly re-masking observed entries during training and reconstructing them, showing strong results on benchmark datasets. Our work builds on this line but differs in key respects: we frame imputation as conditional marginal prediction rather than regression to observed entries, enabling uncertainty-aware downstream decisions; we introduce compositional entity embeddings to capture structured variables; and we use an encoder-only design without positional order. While REMASKER validates the potential of masked autoencoding for imputation, our approach extends it to a setting that supports conditional distribution prediction over structured variables.
Active feature acquisition. A related line of work trains agents to decide which features to observe before making a prediction (Saar-Tsechansky et al., 2009; Li & Oliva, 2020; Yin et al., 2020). These methods typically combine a classifier with a sequential acquisition policy optimizing a joint objective. Our contribution is orthogonal: we produce the calibrated conditional marginals that are a prerequisite for VOI computation, rather than the acquisition policy itself. Combining the MARFORMER with a VOI-based acquisition policy is a natural direction for future work.
Prior generative imputation methods represent distributions over missing values (Yoon et al., 2018; Mattei & Frellsen, 2019; Nazabal et al., 2018), while tabular methods typically operate on a fixed set of columns (Du et al., 2023; Caruso et al., 2024). MICE uses a collection of conditional models in an iterative imputation procedure (Buuren & Groothuis-Oudshoorn, 2011). Our approach directly predicts conditional marginals with shared neural parameters and relational structure among variables and entities.
An example of such tasks is active feature acquisition, where conditional marginals allow a principled choice of the next variable to observe via VOI ( 2.2).
9 Discussion and Limitations
We introduced the MARFORMER, a Transformer that directly predicts conditional marginal distributions over missing values. It replaces inference in a specified generative model with a single forward pass learned from incomplete training data. Across three synthetic domains with known ground truth, the MARFORMER can match or outperform methods with access to the correct generative family, although a gap remains to Stan Oracle in the synthetic annotation domain. On real data, the MARFORMER improves overall with training scale and outperforms the evaluated baselines at the largest training size, while running at a fraction of Stan's cost.
The MARFORMER has three notable limitations. First, our justification for masked autoencoding assumes MCAR training instances. If missingness is informative, even in the weaker MAR sense, where observation depends on other observed values, artificially masked training examples need no longer represent the same conditional distribution as naturally missing ones, and learned conditional distributions may be systematically biased. Second, the MARFORMER predicts conditional marginals without enforcing their compatibility with a coherent joint distribution. Third, calibration matters for active learning: overconfident conditional predictions can lead to overconfident VOI estimates and suboptimal acquisition decisions. The layerwise analysis in §E illustrates how calibration develops through the model's computation.
Deep models that predict output distributions, like , sometimes overfit to the training examples, leading them to predict low-entropy distributions in general (Wong-Toi et al., 2024). Our experiments show that calibration can deteriorate with limited training data (see Figures 9 and 11). Overfitting may be reduced by our regularization and early stopping, or by the fact that random masking generates exponentially many training examples. Still, the model could generalize poorly to test examples that are unlike any training examples. Consider MCAR bandit data, in which every instance has or . Half of the test examples ask to predict from , but there are no training examples of this form, only predicting from . Whether depends on cannot be resolved by the training data, but is wholly determined by the inductive bias of the learner. We would like to ensure that the model will yield a high-entropy predictive distribution on inputs where the prediction is underconstrained by the training data. If regularization does not achieve this, it might help to add a second regularizer to equation (19) that explicitly rewards predictive entropy on held-out real or synthetic inputs from the test distribution . Ensemble learning is another way to achieve this goal, by returning a mixture of plausible predictive distributions (e.g., Lakshminarayanan et al., 2017). In the example, we might be able to predict with low entropy if we knew whether it was positively or negatively correlated with , but since we do not know, we take a mixture of many possibilities, which has high entropy.
References
Rami Al-Rfou, Dokook Choe, Noah Constant, Mandy Guo, and Llion Jones. Character-level language modeling with deeper self-attention. In AAAI Conference on Artificial Intelligence, volume 33, pp. 3159–3166. Association for the Advancement of Artificial Intelligence (AAAI), 2018. ISBN 978-1-57735-809-1.
Nora Belrose, Zach Furman, Logan Smith, Danny Halawi, Igor Ostrovsky, Lev McKinney, Stella Biderman, and Jacob Steinhardt. Eliciting latent predictions from transformers with the tuned lens, 2023.
Steffen Bickel, Michael Brückner, and Tobias Scheffer. Discriminative learning under covariate shift. Journal of Machine Learning Research, 10, 2009. ISSN 1532-4435.
R. Darrell Bock and Murray Aitkin. Marginal maximum likelihood estimation of item parameters: Application of an EM algorithm. Psychometrika, 46(4):443–459, 1981.
Monica F. Bugallo, Victor Elvira, Luca Martino, David Luengo, Joaquin Miguez, and Petar M. Djuric. Adaptive importance sampling: The past, the present, and the future. IEEE Signal Processing Magazine, 34(4):60–79, 2017.
S. van Buuren and K. Groothuis-Oudshoorn. mice: Multivariate imputation by chained equations in R. Journal of Statistical Software, 45(3):1–67, 2011.
Emmanuel J. Candes and Benjamin Recht. Exact matrix completion via convex optimization, 2012.
Camillo Maria Caruso, Paolo Soda, and Valerio Guarrasi. Not another imputation method: A transformer-based model for missing values in tabular datasets, 2024.
Venkat Chandrasekaran, Nathan Srebro, and Prahladh Harsha. Complexity of inference in graphical models. In Conference on Uncertainty in Artificial Intelligence, volume R6, pp. 70–78, 2008. Reissued by PMLR on 09 October 2024.
Daiwei Chen, Yi Chen, Aniket Rege, and Ramya Korlakai Vinayak. PAL: Pluralistic alignment framework for learning from heterogeneous preferences. arXiv.org, 2024.
Cyril Chhun, Pierre Colombo, Fabian M. Suchanek, and Chlo'e Clavel. Of human criteria and automatic metrics: A benchmark of the evaluation of story generation. In Nicoletta Calzolari, Chu-Ren Huang, Hansaem Kim, James Pustejovsky, Leo Wanner, Key-Sun Choi, Pum-Mo Ryu, Hsin-Hsi Chen, Lucia Donatelli, Heng Ji, Sadao Kurohashi, Patrizia Paggio, Nianwen Xue, Seokhwan Kim, Younggyun Hahm, Zhong He, Tony Kyungil Lee, Enrico Santus, Francis Bond, and Seung-Hoon Na (eds.), International Conference on Computational Linguistics, 2022.
Clyde H. Coombs. Psychological scaling without a unit of measurement. Psychology Review, 57(3):145–158, 1950.
Gregory F. Cooper. The computational complexity of probabilistic inference using Bayesian belief networks. Artificial Intelligence, 42(2-3):393–405, 1990.
A. P. Dawid. Present position and potential developments: Some personal views: Statistical theory: The prequential approach. Journal of the Royal Statistical Society. Series A (General), 147(2):278, 1984.
A. P. Dempster, N. M. Laird, and D. B. Rubin. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society. Series B (Methodological), 39(1):1–38, 1977. ISSN 00359246.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio (eds.), Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186. Association for Computational Linguistics, 2019.
Tianyu Du, Luca Melis, and Ting Wang. ReMasker: Imputing tabular data with masked autoencoding, 2023.
C. K. Enders. Missing data: An update on the state of the art. Psychological Methods, 30(2):322–339, 2023.
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning, 2017.
A. E. Gelfand and A. F. M. Smith. Sampling-based approaches to calculating marginal densities. Journal of the American Statistical Association (JASA), 85:398–409, 1990.
J. Gentle, G. McLachlan, and T. Krishnan. The EM Algorithm and Extensions, volume 54. JSTOR, 1st edition, 1996.
Alan Genz. Numerical computation of multivariate normal probabilities. Journal of Computational and Graphical Statistics, 1(2):141–149, 1992. ISSN 10618600.
Cedric Ginestet. Introduction to Statistical Relational Learning, volume 173. Oxford University Press (OUP), 2010.
Tilmann Gneiting and Adrian E. Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102(477):359–378, 2005.
Yury Gorishniy, Ivan Rubachev, Valentin Khrulkov, and Artem Babenko. Revisiting deep learning models for tabular data, 2021.
David Harwath, Karen Livescu, Georg Heigold, and Shankar Kumar. Omnimodal encoders. Jsalt 2026 workshop proposal, Center for Language and Speech Processing, Johns Hopkins University, 2026.
Helia Hashemi, Jason Eisner, Corby Rosset, Benjamin Van Durme, and Chris Kedzie. LLM-rubric: A multidimensional, calibrated approach to automated evaluation of natural language texts. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Annual Meeting of the Association for Computational Linguistics, pp. 13806–13834. Association for Computational Linguistics, 2024.
Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. Masked autoencoders are scalable vision learners, 2021.
John R. Hershey, Jonathan Le Roux, and Felix Weninger. Deep unfolding: Model-based inspiration of novel deep architectures. arXiv.org, 1409.2574, 2014.
Ronald A. Howard. Bayesian decision models for system engineering. IEEE Transactions on Systems Science and Cybernetics, 1(1):36–40, 1965.
Ronald A. Howard. Information value theory. IEEE Transactions on Systems Science and Cybernetics, 2(1):22–26, 1966.
Xin Huang, Ashish Khetan, Milan Cvitkovic, and Zohar Karnin. TabTransformer: Tabular data modeling using contextual embeddings, 2020.
Niels Bruun Ipsen, Pierre-Alexandre Mattei, and Jes Frellsen. not-MIWAE: Deep generative modelling with missing not at random data, 2020.
Oleg Ivanov, Michael Figurnov, and Dmitry Vetrov. Variational autoencoder with arbitrary conditioning. In International Conference on Learning Representations, 2019.
Raghunandan H. Keshavan, Andrea Montanari, and Sewoong Oh. Matrix completion from a few entries, 2009.
Paul Kvam, Brani Vidakovic, and Seong joon Kim. Nonparametric Statistics with Applications to Science and Engineering with R. Wiley, 2nd edition, 2022.
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, volume 30, 2017.
Chen-Yu Lee, Saining Xie, Patrick Gallagher, Zhengyou Zhang, and Zhuowen Tu. Deeply-supervised nets. In International Conference on Artificial Intelligence and Statistics, volume 38 of Proceedings of Machine Learning Research, pp. 562–570, 09–12 May 2014.
Steven Cheng-Xian Li, Bo Jiang, and Benjamin Marlin. MisGAN: Learning from incomplete data with generative adversarial networks, 2019.
Yang Li and Junier Oliva. Active feature acquisition with generative surrogate models. In Marina Meila and Tong Zhang (eds.), International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 6450–6459. PMLR, 18–24 Jul 2020.
Yang Li, Jie Ma, Miguel Ballesteros, Yassine Benajiba, and Graham Horwood. Active evaluation acquisition for efficient LLM benchmarking, 2024.
Stuart R. Lipsitz and Joseph G. Ibrahim. A conditional model for incomplete covariates in parametric regression models. Biometrika, 83(4):916–922, 1996.
Roderick J. Little. Missing data assumptions. Annual Review of Statistics and Its Application, 8(Volume 8, 2021):89–107, 2021. ISSN 2326-831X.
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2017.
Anders L. Madsen and Finn V. Jensen. LAZY propagation: A junction tree inference algorithm based on lazy evaluation. Artificial Intelligence, 113(1–2):203–245, 1999. ISSN 0004-3702.
Ian Magnusson, Akshita Bhagia, Luca Soldaini, Dustin Schwenk, Pete Walsh, Yan Elazar, Kyle Lo, Dirk Groeneveld, Iz Beltagy, Hannaneh Hajishirzi, et al. DataDecide: How to predict best pretraining data with small experiments. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research. PMLR, 2025.
Pierre-Alexandre Mattei and Jes Frellsen. MIWAE: Deep generative modelling and imputation of incomplete data, 2019.
Rahul Mazumder, Trevor Hastie, and Robert Tibshirani. Spectral regularization algorithms for learning large incomplete matrices. Journal of Machine Learning Research, 11(80):2287–2322, 2010.
Calvin McCarter. Unmasking trees for tabular data, 2025.
Geert Molenberghs, Caroline Beunckens, Cristina Sotto, and Michael G. Kenward. Every missingness not at random model has a missingness at random counterpart with equal fit. Journal of the Royal Statistical Society Series B: Statistical Methodology, 70(2):371–388, 2008.
Alfredo Nazabal, Pablo M. Olmos, Zoubin Ghahramani, and Isabel Valera. Handling incomplete heterogeneous data using VAEs, 2018.
Behnam Neyshabur, Srinadh Bhojanapalli, D. McAllester, and N. Srebro. Generalization in deep learning. In Philipp Grohs and Gitta Kutyniok (eds.), Neural Information Processing Systems, pp. 112—148. Cambridge University Press, 2017.
Hiroki Ouchi, Jun Suzuki, and Kentaro Inui. Transductive learning of neural language models for syntactic and semantic analysis. In Kentaro Inui, Jing Jiang, Vincent Ng, and Xiaojun Wan (eds.), Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 3663–3669. Association for Computational Linguistics, 2019.
Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. DynamicViT: Efficient vision transformers with dynamic token sparsification. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan (eds.), Neural Information Processing Systems, volume 34, pp. 13937–13949. Curran Associates, Inc., 2021.
Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. In Jennifer Dy and Andreas Krause (eds.), International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 4334–4343. PMLR, 10–15 Jul 2018.
Christian P. Robert. The Metropolis-Hastings algorithm, 2016.
Dan Roth. On the hardness of approximate reasoning. Artificial Intelligence, 82(1-2):273–302, 1996.
Donald B. Rubin. Inference and missing data. Biometrika, 63(3):581–592, 1975.
Maytal Saar-Tsechansky, Prem Melville, and Foster Provost. Active feature-value acquisition. Management Sciences, 55(4):664–684, 2009.
Shaun Seaman, John Galati, Dan Jackson, and John Carlin. What is meant by “missing at random”? Statistical Science, 28(2):257–268, 2013.
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In North American Chapter of the Association for Computational Linguistics, pp. 464–468. Association for Computational Linguistics, 2018.
Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. Meta-Weight-Net: Learning an explicit mapping for sample weighting. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
Andrew Smith, Trevor Cohn, and Miles Osborne. Logarithmic opinion pools for conditional random fields. In Annual Meeting of the Association for Computational Linguistics, pp. 18–25. Association for Computational Linguistics, June 2005.
Gowthami Somepalli, Micah Goldblum, Avi Schwarzschild, C. Bayan Bruss, and Tom Goldstein. SAINT: Improved neural networks for tabular data via row attention and contrastive pre-training, 2021.
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014.
D. Stekhoven and P. Bühlmann. MissForest – non-parametric missing value imputation for mixed-type data. Bioinform., 28(1):112–118, 2011.
Veselin Stoyanov and Jason Eisner. Fast and accurate prediction via evidence-specific MRF structure. In ICML Workshop on Inferning: Interactions between Inference and Learning, 2012. 6 pages.
Veselin Stoyanov, Alexander Ropson, and Jason Eisner. Empirical risk minimization of graphical model parameters given approximate inference, decoding, and model structure. In Geoffrey Gordon, David Dunson, and Miroslav Dudik (eds.), Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pp. 725–733, Fort Lauderdale, FL, USA, 11–13 Apr 2011. PMLR.
Andreas Stuhlmüller, Jacob Taylor, and Noah Goodman. Learning stochastic inverses. In Advances in Neural Information Processing Systems 26, pp. 3048–3056. 2013.
Ruoyu Sun, Dawei Li, Shiyu Liang, Tian Ding, and Rayadurgam Srikant. The global landscape of neural networks: An overview. IEEE Signal Processing Magazine, 37(5):95–108, 2020.
M. Tanner, W. Wong, A. Dempster, C. Morris, D. Rubin, and S. Haberman. The calculation of posterior distributions by data augmentation. Journal of the American Statistical Association, 82(398):528–540, 1987.
Benigno Uria, Marc-Alexandre Côté, Karol Gregor, Iain Murray, and Hugo Larochelle. Neural autoregressive distribution estimation. Journal of Machine Learning Research, 17(1):7184–7220, 2016.
Vladimir N. Vapnik. Statistical Learning Theory. John Wiley & Sons, 1998.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need, 2017.
Tim Vieira and Jason Eisner. Learning to prune: Exploring the frontier of fast and accurate parsing. Transactions of the Association for Computational Linguistics, 5:263–278, 2017.
Robert Walecki, Kostis Gourgoulias, Adam Baker, Chris Hart, Chris Lucas, Max Zwiessele, Albert Buchard, Maria Lomeli, Yura Perov, and Saurabh Johri. Universal marginaliser for deep amortised inference for probabilistic programs, 2019.
G. C. G. Wei and M. A. Tanner. A Monte Carlo implementation of the EM algorithm and the poor man's data augmentation algorithms. Journal of the American Statistical Association, 85(411):699–704, 1990.
Halbert White. Maximum likelihood estimation of misspecified models. Econometrica, 50(1):1, 1982. ISSN 00129682, 14680262.
Eliot Wong-Toi, Alex Boyd, Vincent Fortuin, and Stephan Mandt. Understanding pathologies of deep heteroskedastic regression. In Proceedings of the Fortieth Conference on Uncertainty in Artificial Intelligence, 2024.
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R. Salakhutdinov, and Quoc V Le. XLNet: Generalized autoregressive pretraining for language understanding. In Neural Information Processing Systems, pp. 5753–5763. Curran Associates, Inc., 2019.
Haiyan Yin, Yingzhen Li, Sinno Jialin Pan, Cheng Zhang, and Sebastian Tschiatschek. Reinforcement learning with efficient active feature acquisition, 2020.
Jinsung Yoon, James Jordon, and Mihaela van der Schaar. GAIN: Missing data imputation using generative adversarial nets, 2018.
Wenshuai Zhao, Jorge Peña Queralta, and Tomi Westerlund. Sim-to-real transfer in deep reinforcement learning for robotics: A survey. In 2020 IEEE Symposium Series on Computational Intelligence (SSCI), pp. 737–744. IEEE, 2020.
A Results in MAR Setting

(a) Domain 1 (BN): Sequential MAR

(b) Domain 2 (Gaussian): Sequential MAR
Figure 12: Learning curves, similar to Figure 4 but where Train is MAR rather than MCAR. Despite the biased training examples, performance is qualitatively similar, though loss for all methods is higher in Domain 1.

(a) Domain 1 (Sequential MAR)

(b) Domain 2 (MAR)
Figure 13: Prediction-by-prediction comparison of two methods, similar to Figure 5 but where the models were trained on MAR rather than MCAR data.
We rerun the comparisons of §4.5 (Domain 1) using Train and Test datasets that are MAR but not MCAR. Training remains valid for MAP-EM, but the naive masking method that we use for MARFORMER training in this paper now produces biased examples.
Specifically, we use a sequential MAR missingness mechanism, which has the form
Similarly to §4.1, each factor has the form of a logistic regression model. Here the model for factor has two binary features for each , indicating whether is missing () and whether is observed to be 1 ( and ). It also has a bias term. The parameters are drawn i.i.d. from .
Owing to the symmetry of this construction, about half of the variables on any instance are missing, just as in the MCAR data of §4.2.
We similarly rerun the comparisons of §5.5 (Domain 2) under MAR missingness.
For MARFORMER training, we apply the same simple masking mechanism as in §4.3, in which each variable is masked with independent probability of 0.15.
Results are shown in Figures 12 and 13.
B Domain Specifications
The following two domain algorithms provide complete specifications of the data-generating processes for Domains 1 and 2, summarizing the generative models, missingness mechanisms, and modeling setups described in §4.1 and §5.1. The color coding follows the structure of the algorithms: grey for given quantities (data source family), red for the data generation process, and blue for the modeling choices.
Algorithm 1 BN Domain: Data Source, Generation and Modeling
Given
- Domain Family: DAGs with binary attributes and target parent density .
- Generate Multiple Data Sources: For each data source , sample and .
Data Generation (for each data source)
- For : ,
- (Naturally Observed)
- Split: Training for , Test for
Modeling EM Baseline:
- Input: for
- EM algorithm with multiple restarts
- Evaluate:
MARFORMER:
- Input: for
- Artificial masking:
- Learn
- Evaluate:
C Additional Results: Domain 3 (Synthetic)
Stan HMC configuration
The predictive fits use one HMC chain, 300 warmup iterations and 500 post-warmup samples, adapt_delta=0.85, max_treedepth=12, and random initialization.
Algorithm 2 Discretized Multivariate Gaussian Domain: Data Source, Generation and Modeling
Given
-
Domain Family: Multivariate Gaussian distribution with dimensions (attributes) and bins for each dimension.
-
Generate Multiple Data Sources: For each data source , sample from the softly constrained Wishart prior described in §5.1, and sample for each . Set for .
Data Generation (for each data source)
-
-
For :
(a)
(b) Set , where is the standard normal CDF, and .
(c)
-
(Naturally Observed)
-
Split: Training for , Test for
Modeling
MAP Baseline:
-
Input: for
-
MAP model with Genz's Algorithm (Genz, 1992) evaluating the observed likelihood
-
Evaluate:
MARFORMER: Same as Algorithm 1
Item Generalization: Test Log Loss (mean SD)

(a) Item Generalization

(b) Judge Generalization
Figure 14: Full log-loss curves including all baselines. Empirical baselines (Unigram Pool, Structured NB, Log-Linear) generally have higher log-loss than the Marformer and Stan variants at larger training sizes in both settings.
C.1 Stan Posterior Predictive Calculation
For completeness, we give the calculation used to obtain the categorical predictive distribution from each posterior sample in the Stan CPM. For posterior sample , let , and denote the corresponding latent score, normalization scale, ordinal thresholds, and measurement-noise parameter defined

(a) Item Generalization

(b) Judge Generalization
Figure 15: Full MBR-L2 curves including all baselines. The empirical baselines generally have higher squared error than the Marformer and Stan variants at larger training sizes in both settings.

(a) Item Generalization

(b) Judge Generalization
Figure 16: Synthetic annotation runtime (minutes). MARFORMER costs are hypothetical estimates of a shortened validation search plus the measured refit, using the accounting in §6.6; Stan costs cover its measured HMC fit.
by the CPM in §6.1. The probability assigned to category c is
Averaging these probabilities across posterior samples gives the posterior predictive marginal reported in the main text.
D Additional Results: Domain 3 (Real Data)
Stan CPM Posterior Hyperparameters
Table 1 reports the posterior marginal distributions of the five Stan CPM scale hyperparameters, inferred from the full LLMRubric training set ( ) with weakly informative priors. The relatively large posterior mean for ( 11.6) compared to ( 2.1) and ( 1.2) indicates that prototype-level variation is the dominant source of judge-to-judge differences, with criterion–prototype interactions at a much smaller scale. The small measurement noise ( 0.38) suggests that the ordinal thresholds capture most of the rating variability. These posterior distributions informed the prior scale choices for synthetic data generation in §6.1.
LLMRubric Item Generalization: Runtime by Training Items

Figure 17: Wall-clock runtime (minutes) for MARFORMER and Stan CPM on LLMRubric as a function of training items. Stan CPM is run with the HMC configuration described in §C. At , the recorded training times are approximately 22 minutes for MARFORMER and 162 minutes for Stan CPM. The MARFORMER uses best-validation checkpoint selection without refitting.
Table 1: Posterior marginal summaries of Stan CPM scale hyperparameters estimated from LLMRubric (, weakly informative priors). Mean, SD, and percentiles are computed from HMC posterior samples.
| Parameter | Role | Mean | SD | 5th %ile | Median | 95th %ile |
|---|---|---|---|---|---|---|
| Criterion vector scale | 2.127 | 0.475 | 1.542 | 2.014 | 3.065 | |
| Prototype vector scale | 11.588 | 1.713 | 9.028 | 11.445 | 14.564 | |
| Criterion-prototype interaction scale | 1.242 | 0.254 | 0.874 | 1.234 | 1.716 | |
| Measurement noise | 0.383 | 0.043 | 0.317 | 0.381 | 0.453 | |
| Rating scale concentration | 5.201 | 0.417 | 4.563 | 5.186 | 5.958 |
E Logit Lens Analysis
At each layer , the MARFORMER maintains a parameter slice , which is read off at the final layer as the predicted rating distribution. For missing ratings, this slice initially encodes a uniform distribution; attention layers then update it using the observed ratings. To examine how these predictions develop, we apply logit and tuned lenses (Belrose et al., 2023) to the transductive Domain 3 model trained at , with layers. We evaluate all readouts on the same 316 missing ratings in the test corner used for the main item-generalization results, as detailed in §6.2.
We construct three readouts at each layer . The Param Lens interprets the parameter slice directly, applying softmax to its rating logits. The Tuned Param Lens instead learns an affine map from that slice to rating logits, minimizing KL divergence to the final model's predicted distributions. This asks whether an intermediate representation can already recover those predictions through a learned readout. The Tuned 80d-Lens uses the same procedure on the full -dimensional residual stream, , to examine what the feature slice adds. The MARFORMER is frozen while separate probes are fitted for each layer. Probe inputs are standardized, and the probes are trained for 300 epochs with AdamW at learning rate on a held-out set of training-missing ratings. Their training targets are the final model's distributions, not the true rating labels.

Param Lens
Tuned Param Lens
Tuned 80d-Lens
Final Model
Figure 18: Log-loss and MBR-L2 for three layerwise readout probes, evaluated on 316 missing test ratings at . Layer 0 is the input representation before attention, and layer 8 is the final layer. The dashed line gives the final model's performance; the raw Param Lens at layer 8 reproduces this output.
Figure 18 suggests that early layers aggregate evidence in the latent representations, while later layers gradually align this information with the parameter coordinates. After one attention layer, the Tuned 80d-Lens achieves log-loss 0.946, while the raw Param Lens remains at 1.264. The Tuned Param Lens achieves 0.970. Thus, useful predictions can already be read from the hidden state even though the raw parameter coordinates do not yet express them. The full-state probe has slightly lower loss than the parameter-only probe at this layer.
By layer 3, both tuned lenses have log-loss close to the final model's 0.827. From layers 3–8, the Tuned 80d-Lens stays near 0.831, whereas the raw Param Lens improves overall but not monotonically. In particular, its log-loss falls from 1.117 at layer 6 to 0.950 at layer 7 and 0.827 at layer 8. The final two layers therefore make substantial contributions to the raw readout, even after a learned probe can recover predictions close to the final model's. MBR-L2 shows the same broad pattern: the tuned readouts approach the final model early, while the raw readout continues to improve through later layers.
The two-stage improvement in the tuned readouts suggests a possible message-passing interpretation. One hypothesis is that the model performs two rounds of a learned message-passing procedure. Alternatively, the first attention layer may aggregate direct evidence from observed ratings, while subsequent layers incorporate indirect evidence relayed through intermediate representations, accounting for the further improvement by layer 3.



Figure 19: Calibration diagrams for the three readouts (rows) at layers 0, 4 and 8 (columns), on the same 316 missing test ratings. Predicted probabilities for all four rating categories are pooled. The diagonal indicates perfect calibration; titles report smECE and relplot's reported calibration-error width from 500 bootstrap resamples. The layer-0 Param Lens predicts 1/4 for every category due to the initialization.
Calibration also changes across depth, although all three readouts remain reasonably well calibrated (Figure 19). At layer 4, the raw Param Lens has smECE 0.073, compared with 0.026 for the Tuned Param Lens and 0.043 for the Tuned 80d-Lens. At the output, the raw Param Lens reaches 0.042. Its smECE is not monotone across layers: it ranges from 0.065 to 0.078 at layers 1–6, then falls to 0.063 at layer 7 and 0.042 at layer 8. As with log-loss, the last two layers improve the raw predictions. The uniform layer-0 readout has zero all-class smECE but log-loss ln 4, illustrating that calibration alone does not measure how informative a prediction is.
Together, these readouts show that predictions close to the final model's can be recovered from intermediate representations, while the raw parameter slice requires further computation to express them. This is consistent with the MARFORMER learning an iterative refinement procedure (Stoyanov et al., 2011): early layers gather evidence, and later layers refine the distribution that is read off directly at the output.