TL;DR
Tabular foundation models like TabPFN can natively handle missing values at test time, but they often stumble when your labeled training examples are complete while your incoming deployment batch is missing entire groups of features. QDMAC (Query-Distribution Mask-Aligned Context) fixes this without any model training: it peeks at which features are missing in the unlabeled query batch (never their values or labels) and applies that exact missingness pattern to the labeled context. Across 23 datasets under simulated panel dropout, this simple, single-call trick consistently improved TabPFN's probabilistic predictions.
What Problem Does This Paper Address?
In-context learning has arrived for tabular data. Models like TabPFN don't train on your dataset in the traditional sense; instead, you feed them a labeled "context" table and an unlabeled "query" batch together in a single forward pass, and the transformer predicts the query labels on the fly.
While TabPFN natively understands NaNs, a subtle context-distribution mismatch arises in real-world deployment. Imagine a clinical model whose labeled context comes from a hospital that ran a full laboratory panel on every patient. Now you deploy it on a batch of patients from clinics where different groups of tests ("panels") were skipped for different people. TabPFN sees the missing entries in each query row, but its labeled context contains only pristine, fully observed rows. The model is essentially asked to interpret incomplete records using examples whose observation process looks nothing like the current batch.
Methods
The authors introduce QDMAC, a deterministic, training-free, single-call transformation of the labeled context:
- Read only the masks: QDMAC inspects the unlabeled query batch to see which feature panels are missing in each row (its "mask signature"), ignoring all feature values and labels.
- Measure the distribution: It computes the empirical frequency of each mask signature in the query batch.
- Align within classes: For each class in the labeled context, QDMAC allocates those exact mask signatures to context rows using largest-remainder apportionment. Doing this within each class prevents missingness patterns from becoming an accidental shortcut for the class label.
- Union and predict: The assigned masks are combined with any naturally missing values in the context, and the aligned context plus the masked query batch are passed to TabPFN in one standard call.
To contextualize QDMAC, the authors compared it against:
- Native TabPFN: Unmodified context, masked queries.
- Mask-Matched Deletion (MMD): Groups query rows by their exact mask signature, deletes the missing columns from both context and query, and runs a separate TabPFN call per group (up to 25 calls per batch).
- Imputation baselines: Context-fit median/mode imputation, plus post-hoc $k$-nearest-neighbour (kNN) and chained-equations imputation.
- LightGBM: An untuned, fixed reference configuration.
Datasets
The study evaluated 23 classification datasets from OpenML, divided into two separately frozen cohorts:
- Initial confirmatory cohort (8 datasets): 569–5,620 rows, 20–216 features, and 2–10 classes.
- Independent-dataset replication cohort (15 datasets): Algorithmically selected from OpenML-CC18 prior to inference, spanning 522–5,456 rows, 10–500 features, and 2–10 classes.
To simulate heterogeneous panel dropout, features in each dataset were clustered into five correlated panels using Spearman rank correlation. For every query row, 1 to 3 panels were randomly dropped, producing ~40% artificial missingness and up to 25 distinct mask signatures per batch.
Key Insights and Ideas
- Leaving values missing beats simple imputation: Median/mode, kNN, and chained-equations imputation all worsened TabPFN's log loss compared to native TabPFN. For a model that natively encodes missingness, filling in an unavailable panel with a point estimate destroys the signal that the panel was missing.
- Masking helps, and alignment adds a bonus: A post-hoc control that masked context rows at the exact same rate as QDMAC—but uniformly at random rather than matching the query signatures—captured a large share of the improvement. Aligning to the actual query-mask distribution added a smaller, consistent gain on top.
- One call comes with a trade-off: The authors hypothesized that QDMAC would recover more than half of the log-loss improvement achieved by multi-call MMD. That supporting claim was not supported—QDMAC trades some mask-specific consistency for keeping inference to a single TabPFN call.
Key Results
- Primary outcome (log loss):
- Initial cohort: QDMAC improved log loss over native TabPFN on 7 of 8 datasets (median gain 0.0491 nats, two-sided exact Wilcoxon $p = 0.0234$).
- Replication cohort: QDMAC improved log loss on 12 of 15 datasets (median gain 0.0308 nats, $p = 0.0103$).
- Secondary metrics: In the replication cohort, top-label accuracy barely budged (median +0.0004), but balanced accuracy (+0.0188), macro AUROC (+0.0050), and calibration error (median reduction 0.0097) improved. The log-loss gains came primarily from better-calibrated probabilities and minority-class predictions.
- Versus imputation: QDMAC outperformed median/mode imputation on 14 of 15 replication datasets (median advantage 0.1650 nats, $p = 0.00061$), and similarly beat kNN and chained-equations imputation.
Limitations and Future Work
- Sensitivity to nominal coding: Because panels were built using Spearman rank correlation on integer-coded categoricals, the resulting partitions depended on arbitrary code ordering for datasets with multi-level nominal features. When those 8 datasets were removed post hoc, the replication test lost statistical significance ($p = 0.2754$ on the 10 invariant datasets). Rebuilding panels with a mixed-type association measure is a clear next step.
- Synthetic missingness: Panel dropout was synthetic and independent of feature values or labels; real-world acquisition missingness may behave differently.
- Batch-transductive: QDMAC requires observing the query batch's missingness pattern before predicting, which limits its use in streaming or very small-batch settings.
- Scope: Results are specific to TabPFN V3 (default checkpoint) on OpenML classification tasks and do not benchmark against learned/foundation imputers (e.g., missForest, GAIN, TabImpute) or tuned gradient-boosted trees.
Summary updated