arXiv:2610.06751cs.LGOct 2026

Manuscript Offprint

arXiv:2610.06751

MatrixFormer: A Foundation Model for Matrix Completion

Dwaipayan Saha, Jacob Feitelberg, Kyuseong Choi, Raaz Dwivedi, Anish Agarwal

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

Abstract

Matrix completion underlies problems from tabular imputation to causal inference, yet existing tabular foundation models treat it as entry-by-entry prediction, repeating context for every target and discarding the matrix's two-dimensional structure. We introduce MatrixFormer, a pre-trained matrix-native transformer that predicts a full distribution for every missing entry in a single forward pass. MatrixFormer is trained entirely on synthetic low-rank and latent-factor matrices under diverse missingness patterns. Applied zero-shot and with the same model weights, MatrixFormer achieves competitive performance on causal inference panel-data tasks, language-model benchmark-score completion, tabular imputation, and recommendation systems matrix completion. These results position MatrixFormer as a general-purpose foundation model for matrix completion.

1 Introduction

Clinical measurements, user ratings, and language-model benchmark scores [Smola, 2026] are often recorded in partially observed matrices. Predicting untreated outcomes in panel data creates a related completion problem [Athey et al., 2021]. Across these settings, observed entries supply information about both rows and columns. We study how to pretrain a completion model that can use this information across different matrix sizes and observation patterns.

Low-rank methods capture matrix structure through shared row and column factors [Candès and Recht, 2009, Salakhutdinov and Mnih, 2007], while chained-equation and model-selection imputers fit conditional prediction models [van Buuren and Groothuis-Oudshoorn, 2011, Jarrett et al., 2022]. These methods estimate their parameters from the observed entries of each new matrix. Synthetic pretraining moves part of that computation into a reusable model. Prior-data fitted networks learn prediction rules from synthetic tasks, then use observations from a new dataset as context [Müller et al., 2022, Hollmann et al., 2025].

TabImpute [Feitelberg et al., 2025] applied synthetic pretraining to missing-data imputation. Its configurable missingness generator produces specialists for particular observation patterns. An entry-wise representation makes tabular prediction models applicable to completion: each matrix entry becomes a supervised example containing its row and column context. An R×CR \times C matrix therefore produces a table of RC examples whose features repeat the same observed values. This expansion raises the memory and runtime cost of completing larger matrices. We replace the expanded feature table with a shared two-dimensional representation.

We introduce MatrixFormer, an observed-error ensemble of two fixed pretrained experts: the general-purpose MatrixFormer-Impute and the recommender-specific MatrixFormer-RecSys. MatrixFormer-Impute is a transformer pretrained for matrix completion. The input is a grid of cell

Preprint.

tokens with explicit missingness indicators. Attention alternates across the columns of each row and the rows of each column, following work on axial and cross-datapoint attention [Ho et al., 2019, Kossen et al., 2021, Rao et al., 2021, Hollmann et al., 2025]. These operations let a cell combine information about other measurements of the same unit with information about the same measurement across units. A shared decoder predicts all missing entries in an inference window together, using the means of its cellwise predictive distributions. In the fixed-width runtime experiment on an NVIDIA H200, MatrixFormer completes the 1024×101024 \times 10 synthetic matrix in a median of 0.0389 s, compared with 4.167 s for TabImpute. This is a 107×107 \times speedup (section 3.1).

MatrixFormer-Impute is trained entirely on synthetic matrices with varied ranks, singular-value profiles, dimensions, and missingness patterns. The training distribution includes sparse rows and columns to model limited observation support. At deployment, observed entries provide context and the model weights remain fixed.

MatrixFormer combines MatrixFormer-Impute with MatrixFormer-RecSys, a recommender specialist also trained on synthetic data. One mixture weight per input matrix minimizes the blend's normalized squared reconstruction error on observed entries. Both networks retain their pretrained parameters. Since the observed entries are also part of the input, this fit uses in-sample evidence. We assess the blend on separately hidden entries. MatrixFormer requires both expert forward passes.

We evaluate on tabular imputation, recommender-system rating prediction, language-model benchmark completion, and a causal panel-data benchmark. Across these tasks, we test dense and sparse observation patterns and matrices much larger than those used in pretraining. MatrixFormer achieves state-of-the-art results in each of these categories with the same fixed model parameters.