Supervised learning pays attention
Erin Craig, Robert Tibshirani
TL;DR
The paper tackles heterogeneity in tabular data by introducing supervised attention to weight training examples for each test point, producing personalized, interpretable local models anchored to a global baseline. It formulates a practical two-step approach: estimate supervised similarity via random forest proximity, then fit a weighted local model and blend with the global model; it specializes this to the attention lasso and demonstrates strong predictive gains on real and simulated data. Key contributions include the attention lasso with interpretable per-point coefficients clustered via protoclust, extensions to time series and spatial data, and a method for adapting pretrained tree models to distributional drift without refitting. The work also connects attention concepts to kernel methods and local regression, providing both theoretical and empirical support for reduced error under mixture-of-models and heterogeneous data settings.
Abstract
In-context learning with attention enables large neural networks to make context-specific predictions by selectively focusing on relevant examples. Here, we adapt this idea to supervised learning procedures such as lasso regression and gradient boosting, for tabular data. Our goals are to (1) flexibly fit personalized models for each prediction point and (2) retain model simplicity and interpretability. Our method fits a local model for each test observation by weighting the training data according to attention, a supervised similarity measure that emphasizes features and interactions that are predictive of the outcome. Attention weighting allows the method to adapt to heterogeneous data in a data-driven way, without requiring cluster or similarity pre-specification. Further, our approach is uniquely interpretable: for each test observation, we identify which features are most predictive and which training observations are most relevant. We then show how to use attention weighting for time series and spatial data, and we present a method for adapting pretrained tree-based models to distributional shift using attention-weighted residual corrections. Across real and simulated datasets, attention weighting improves predictive performance while preserving interpretability, and theory shows that attention-weighting linear models attain lower mean squared error than the standard linear model under mixture-of-models data-generating processes with known subgroup structure.
