Abstract
Tabular Foundation Models (TFMs) like TabPFN provide powerful zero-shot capabilities for tabular data but suffer from high inference costs due to the quadratic scaling of self-attention. This paper proposes an entropy-based early-stopping mechanism that utilizes pre-trained, layer-specific decoders to exit the forward pass once a prediction reaches a confidence threshold. Evaluation on various datasets demonstrates up to a 2.2x speedup with minimal impact on predictive performance, maintaining the zero-shot nature of the underlying model.
Introduction
Tabular data is ubiquitous in domains such as finance and healthcare, where rapid decision-making is often required. While gradient-boosted decision trees (e.g., XGBoost) have traditionally dominated this field, they necessitate extensive hyperparameter tuning and retraining for every new task. Tabular Foundation Models (TFMs), specifically TabPFN, have recently emerged as a zero-shot alternative, leveraging in-context learning to generalize to new datasets without task-specific training.
However, the Transformer architecture underlying these models scales quadratically with the context size. In the tabular setting, the context includes the training samples, making inference computationally expensive as datasets grow. This research addresses this bottleneck by introducing a dynamic early-exit strategy that halts the forward pass when the model achieves sufficient predictive confidence.
Methods
The authors implement a dynamic early-stopping mechanism for TabPFNv2. The core innovation involves attaching lightweight, pre-trained decoders to each intermediate Transformer encoder layer.
Layer-Specific Decoders
During the forward pass, the base Transformer remains frozen. Dedicated decoders are trained independently for each layer using synthetic datasets sampled from a mathematical prior. This ensures that the model retains its zero-shot capability, as the decoders never encounter real-world downstream data during training.
Entropy-Based Early Exit
During inference, the system computes the entropy of the prediction at each layer. If the entropy is below a predefined threshold $\tau$, the model stops and outputs the current prediction. If the uncertainty remains high, the data proceeds to the next layer. This allows the model to allocate more computation to difficult samples while quickly processing easier ones.
Experimental Evaluation
The method was evaluated on 34 small-scale tasks (PMLB-mini) and 5 larger classification datasets. The entropy threshold $\tau$ serves as a control for the trade-off between inference speed and predictive accuracy.
Key Results
- Small Datasets: At $\tau = 0.4$, the model achieved a 1.3x speedup, exiting at layer 6.1 on average with a negligible ROC AUC drop (0.886 to 0.873).
- Large Datasets: The benefits are more pronounced on larger contexts. At $\tau = 0.4$, the model reached an average exit layer of 5.0, resulting in a 2.2x speedup. While the ROC AUC decreased from 0.960 to 0.920, the efficiency gains are significant for time-sensitive applications.
- Generalization: Despite being trained on synthetic data with fewer than 1,200 samples, the intermediate decoders generalized effectively to real-world datasets with up to 5,000 samples.
Discussion and Conclusion
A critical finding is that intermediate representations are highly informative, but only when paired with decoders specifically trained for those layers. Simply routing early-layer activations to the final decoder results in poor performance.
While the 2.2x speedup is a substantial improvement, the associated performance trade-off on larger datasets suggests that the entropy threshold must be carefully selected based on the application's sensitivity. Future work may focus on more sophisticated adaptive strategies to further minimize accuracy loss while maximizing throughput, potentially enabling real-time tabular in-context learning at scale.
Summary updated