All models

TabFlex

TabPFN rebuilt on linear attention, so in-context tabular classification scales to millions of rows.

Tabular and recommender · 662 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (14 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
25.8M
Operations
662
Framework
PyTorch
Recurrent
No
Published
ICML 2025
Cited by
0 (as of 17 October 2026)
Authors
Yuchen Zeng, Tuan Dinh, Wonjun Kang, Andreas C Mueller
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m3058
Graph hash
805dd7a825aa8a6133eaaabe2cd5b3d64001e6e282a6e2396f0058203de1d704
Skeleton hash
515f92ec44e3b1ab660c0e1b006e44237d0ecda2efd65b90ddebe09977bfe898
Architecture hash
5c368884cae1ad39dd5fec6df08e2cfb1df2c3423477c71519ee15c949d34a85
Diagram SHA-256
f058d8d1ce5e40ead2b26b90376e391f63022f65324539f2713d4d5653e5b63a
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

TabFlex is a tabular classifier that learns in context, built by taking TabPFN and replacing its quadratic self-attention with linear attention. The payoff is reach: the model handles tabular datasets with thousands of features and hundreds of classes, scaling seamlessly to millions of samples. On the poker-hand dataset, with over a million samples, it finishes in just 5 seconds.

The design came out of a comparison of scalable attention alternatives, which found that the inherent causality of state-space models hinders in-context learning on large datasets while linear attention preserves effectiveness. The prompt layout is inherited from TabPFN: each sample is a token, and attention outputs at test positions attend only to training samples, so every test prediction is independent of the other test samples. The linear attention uses the feature function elu plus one, following the default implementation proposed by Katharopoulos and colleagues.

The released system actually comprises three sub-models, each optimized for different scenarios and selected based on dataset characteristics. The member traced here follows the smallest, TabFlex-S100, which is trained on prompts with 1152 length, 100 features, and 10 classes. All three share the same embedding size of 512, consistent with TabPFN. Its sibling TabFlex-H1K stretches to prompts of 50K length, 1K features, and 100 classes for large, high-dimensional datasets.

Key idea. TabFlex scales TabPFN-style in-context tabular classification by replacing complexity-quadratic self-attention with linear attention. Across the evaluations it achieves over a 2x speedup compared to TabPFN and a 1.5x speedup over XGBoost.

  • TabFlex
  • TabFlex-S100
  • TabPFN
  • linear attention
  • tabular in-context learning
  • ICL
  • tabular classification
  • prior-data fitted network
  • ticl
  • scalable tabular transformer

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{zeng2025tabflexscalingtabularlearning,
      title={TabFlex: Scaling Tabular Learning to Millions with Linear Attention}, 
      author={Yuchen Zeng and Tuan Dinh and Wonjun Kang and Andreas C Mueller},
      year={2025},
      eprint={2506.05584},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2506.05584}, 
}