Skip to main content
QUICK REVIEW

[Paper Review] Retrieval & Fine-Tuning for In-Context Tabular Models

Valentin Thomas, Junwei Ma|arXiv (Cornell University)|Jun 7, 2024
Time Series Analysis and ForecastingComputer Science3 citations
TL;DR

This paper proposes LoCalPFN, a retrieval- and fine-tuning-enhanced version of TabPFN, to improve in-context tabular classification. By using k-nearest neighbors as dynamic context and fine-tuning the model end-to-end, LoCalPFN achieves state-of-the-art performance across 95 OpenML datasets, outperforming both neural and tree-based baselines, including XGBoost and random forests.

ABSTRACT

Tabular data is a pervasive modality spanning a wide range of domains, and the inherent diversity poses a considerable challenge for deep learning. Recent advancements using transformer-based in-context learning have shown promise on smaller and less complex datasets, but have struggled to scale to larger and more complex ones. To address this limitation, we propose a combination of retrieval and fine-tuning: we can adapt the transformer to a local subset of the data by collecting nearest neighbours, and then perform task-specific fine-tuning with this retrieved set of neighbours in context. Using TabPFN as the base model -- currently the best tabular in-context learner -- and applying our retrieval and fine-tuning scheme on top results in what we call a locally-calibrated PFN, or LoCalPFN. We conduct extensive evaluation on 95 datasets curated by TabZilla from OpenML, upon which we establish a new state-of-the-art with LoCalPFN -- even with respect to tuned tree-based models. Notably, we show a significant boost in performance compared to the base in-context model, demonstrating the efficacy of our approach and advancing the frontier of deep learning in tabular data.

Motivation & Objective

  • To address the scaling limitations of transformer-based in-context learning (ICL) models like TabPFN on large and complex tabular datasets.
  • To improve generalization and decision boundary learning in tabular ICL by replacing static full-dataset context with adaptive, local k-NN contexts.
  • To enhance performance through end-to-end fine-tuning on retrieved local contexts, overcoming underfitting in complex or high-cardinality datasets.
  • To establish a new state-of-the-art for tabular classification using a neural approach, outperforming established tree-based models.

Proposed method

  • Retrieves k-nearest neighbors (k-NN) of each query point to form a dynamic, localized context instead of using the full training set.
  • Applies end-to-end fine-tuning on the retrieved k-NN context to adapt the base TabPFN model to local data patterns.
  • Uses an approximate neighbor scheme to enable backpropagation through the retrieval step, enabling differentiable fine-tuning.
  • Combines retrieval and fine-tuning into a unified framework called LoCalPFN (Locally-Calibrated PFN), extending TabPFN’s in-context learning capability.
  • Employs a context size heuristic: minimum of 10×√(n_train) and a predefined maximum, ensuring scalability and stability.
  • Validates performance using a 95-dataset benchmark from TabZilla, comparing against TabPFN, tree-based models, and other ICL variants.
(c) Performance vs. Complexity
(c) Performance vs. Complexity

Experimental results

Research questions

  • RQ1Can replacing the full training set with k-nearest neighbors as context improve in-context tabular classification performance?
  • RQ2Does end-to-end fine-tuning on retrieved local contexts significantly improve generalization and decision boundary learning in complex tabular datasets?
  • RQ3How does the performance of the proposed retrieval-and-fine-tuning framework compare to state-of-the-art tree-based models like XGBoost and random forests?
  • RQ4Is the proposed method robust to variations in the number of neighbors used as context?
  • RQ5Can the framework be extended to improve other in-context tabular foundation models beyond TabPFN?

Key findings

  • LoCalPFN achieves a new state-of-the-art on 95 OpenML datasets, outperforming both neural and tree-based baselines, including XGBoost and random forests.
  • The TabPFN- k NN variant alone improves significantly over vanilla TabPFN, demonstrating the effectiveness of local context retrieval even without fine-tuning.
  • LoCalPFN outperforms the random forest baseline with only 50 neighbors in context and surpasses XGBoost with 500 neighbors, indicating strong sample efficiency.
  • Performance is robust to the choice of k, with stable gains across different context sizes as long as k ≥ 100.
  • The method shows significant performance gains on complex synthetic datasets, such as concentric circles, where vanilla TabPFN fails due to underfitting.
  • Despite higher inference cost than tree-based models, the lightweight TabPFN- k NN variant runs as fast as tree-based models while achieving superior accuracy.
(a) adult-census
(a) adult-census

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.