arXiv:2610.06580cs.LGOct 2026

Manuscript Offprint

arXiv:2610.06580

LinearPFN: Amortized Variable Selection for Linear Models with Interactions

Louis Schiekiera, Max Zimmer, Christophe Roux, Manuel Arnold, Sebastian Pokutta, Fritz Günther

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

ABSTRACT

Spike-and-slab regression is a standard Bayesian formulation of variable selection: it returns a posterior distribution over which candidate effects are active rather than a single selected subset, so that every candidate effect carries an inclusion probability. Its cost grows exponentially with the number of candidate effects, so the posterior can be enumerated exactly only when the number of predictors is small. Beyond that reach, the posterior has to be approximated, typically by Markov chain Monte Carlo over the model space, which requires a fresh run for every dataset and, within a fixed budget of steps, may fail to converge. We present LINEARPFN, a prior-data fitted transformer network that amortizes spike-and-slab inference for linear models with main effects and pairwise interactions. The network is pretrained once on synthetic datasets, drawn from an explicitly specified prior, and a single forward pass over a new dataset returns posterior inclusion probabilities, posterior-mean coefficients and posterior predictive distributions with no per-dataset fitting. The prior is conjugate by design, so that the posterior for each fixed set of active effects has a closed form, and wherever the exact posterior is still computable by enumeration we verify the network's outputs against it. On real predictor matrices from published social-science datasets, with outcomes drawn from the prior so that the true active set is known, LINEARPFN attains a higher per-dataset selection AUC and a higher F1F_{1} under the median probability model rule than five classical baselines. The lead holds when the coefficients, the interactions or the noise depart from the prior. Code: https://github.com/schiekiera/LinearPFN. Trained model: https://huggingface.co/schiekiera/LinearPFN.

1 INTRODUCTION

A linear model explains an outcome y as a weighted sum of predictors, with one coefficient per predictor that gives the change in y per unit of that predictor. Despite the rise of nonlinear statistical modeling, quantitative claims in the sciences are still frequently stated in this form (Cohen et al., 2013): the coefficients are interpretable, their statistical properties are well understood, and each one can be tested directly against the theory that motivated it. Linear models are often extended with pairwise interactions, which state that the effect of one predictor on y depends on the level of a second predictor (Aiken et al., 1991).

Fitting a linear-plus-interaction model requires a decision about which predictors and which interactions to include. A standard Bayesian formulation for variable selection is spike-and-slab regression (Mitchell & Beauchamp, 1988; George & McCulloch, 1993). Its prior either sets each coefficient exactly to zero (the spike) or draws it from a Gaussian (the slab). Under this prior, each model is defined by its active set, the effects whose coefficients are nonzero and thus drawn from the slab, and the posterior is a distribution over these models. The posterior probability that an effect is active is its posterior inclusion probability (PIP). With p predictors the candidate effects are an intercept,