TabClustPFN: A Prior-data Fitted Network for Tabular Data Clustering
Organizations: Renmin University of China · Rutgers University · National University of Singapore
Abstract
Prior-data Fitted Networks (PFNs) have reframed supervised tabular learning as single-pass in-context inference without per-dataset optimization. Extending this paradigm to clustering is appealing yet fundamentally more challenging, due to absent supervision, unknown cluster cardinality, and label switching inherent to partition outputs. Existing PFN-based clustering methods address these challenges only partially, either requiring known cardinality as input or relying on unstable label-ordering conventions and overly restrictive synthetic priors. We introduce TabClustPFN, a clustering PFN that resolves all challenges jointly through co-designed prior, objective, and architecture. Our hybrid pretraining prior captures heterogeneous real-tabular geometry; our decoupled partition inference network--cardinality inference network architecture jointly infers cluster assignments and cardinality in a single pass; and our SoftARI training objective is permutation-invariant by construction, eliminating the need for any label-ordering convention. On a 44 curated real-world tabular benchmark, TabClustPFN achieves state-of-the-art clustering performance against classical, deep, and amortized baselines, with runtime comparable to efficient baselines. Code is available at https://github.com/Tianqi-Zhao/TabClustPFN.
Figures & tables
| Method | ARI Rank [IQR] | NMI Rank [IQR] | -MAE [IQR] |
|---|---|---|---|
| TabClustPFN | 2 [4] | 3 [5] | 0 [1] |
| AP | 14 [1] | 13 [3] | 44 [12] |
| Agg + | 9 [4] | 10 [4] | 1 [4] |
| Birch + | 9 [3] | 10 [3] | 1 [4] |
| DBSCAN | 16 [2] | 17 [1] | 5 [5] |
| GMM + | 6 [4] | 6 [5] | 1 [3] |
| Nominal | 80% | 85% | 90% | 95% | 99% |
|---|---|---|---|---|---|
| Empirical coverage | 0.875 | 0.907 | 0.937 | 0.968 | 0.993 |
| Method | ARI | -MAE | -Acc | Time (ms) |
|---|---|---|---|---|
| DAC (Anc) | 0.5665 | 10.0 | 0.00625 | 257.20 |
| DAC (Min) | 0.5209 | 5.0 | 0.0375 | 235.48 |
| NCP | 0.6000 | 3.0 | 0.08125 | 1058.04 |
| PFN (Random-init) | 0.4222 | 1.0 | 0.4250 | 69.58 |
| PFN (TabICL-init) | 0.6294 | 1.0 | 0.4250 | 71.79 |
| TabClustPFN | 0.7893 | 1.0 | 0.4250 | 70.93 |
| synthetic | Real | ||||
|---|---|---|---|---|---|
| Method | ARI | NMI | ARI | NMI | |
| Naïve (SA + MLP) | 0.8137 | 0.7446 | 0.3589 | 0.3271 | |
| Non-iterative (Transformer) | 0.8229 | 0.7523 | 0.3505 | 0.3865 | |
| Iterative (Ours) | 0.8308 | 0.8000 | 0.3853 | 0.4237 | |
| Method | Synthetic | Real | Time(ms) | |||
|---|---|---|---|---|---|---|
| ARI | NMI | ARI | NMI | |||
| Matching+SoftAcc | 0.8021 | 0.7364 | 0.3814 | 0.4071 | 70.0346 | |
| Matching+CE | 0.8627 | 0.7637 | 0.3507 | 0.4070 | 6.2625 | |
| SoftNMI | 0.7637 | 0.6929 | 0.3915 | 0.4250 | 3.3658 | |
| SoftARI (Ours) | 0.8308 | 0.8000 | 0.3853 | 0.4237 | 2.9695 | |
| Synthetic | Real | ||||
|---|---|---|---|---|---|
| Method | ARI | NMI | ARI | NMI | |
| Additive | 0.8103 | 0.7227 | 0.3544 | 0.3716 | |
| Decoupled (Ours) | 0.8308 | 0.8000 | 0.3853 | 0.4237 | |
| Prior data | Synthetic | Real | ||
|---|---|---|---|---|
| GMM | ZEUS | GMM+ZEUS | ||
| GMM | 0.8236 | 0.5434 | 0.7428 | 0.2270 |
| ZEUS | 0.6758 | 0.8047 | 0.7405 | 0.3414 |
| GMM+ZEUS (Ours) | 0.8230 | 0.8334 | 0.8308 | 0.3853 |
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
| ID | # Instances | # Numerical features | # Categorical features | Dimension | # Classes |
|---|---|---|---|---|---|
| 0 | 511 | 55 | 0 | 55 | 8 |
| 1 | 741 | 33 | 0 | 33 | 2 |
| 2 | 827 | 8 | 0 | 8 | 7 |
| 3 | 993 | 47 | 0 | 47 | 10 |
| 4 | 740 | 23 | 0 | 23 | 6 |
| 5 | 675 | 39 | 0 | 39 | 5 |
| ID | # Instances | # Numerical features | # Categorical features | Dimension | # Classes |
|---|---|---|---|---|---|
| 0 | 649 | 3 | 4 | 7 | 2 |
| 1 | 910 | 18 | 14 | 32 | 7 |
| 2 | 948 | 6 | 43 | 49 | 6 |
| 3 | 905 | 13 | 17 | 30 | 2 |
| 4 | 863 | 14 | 1 | 15 | 2 |
| 5 | 898 | 6 | 0 | 6 | 2 |
| ID | # Instances | # Numerical features | # Categorical features | Dimension | # Classes |
|---|---|---|---|---|---|
| 16 | 2000 | 64 | 0 | 64 | 10 |
| 18 | 2000 | 6 | 0 | 6 | 10 |
| 22 | 2000 | 47 | 0 | 47 | 10 |
| 51 | 294 | 6 | 7 | 13 | 2 |
| 53 | 270 | 13 | 0 | 13 | 2 |
| 481 | 209 | 7 | 1 | 8 | 2 |
| Name | # Instances | # Numerical features | # Categorical features | Dimension | # Classes |
|---|---|---|---|---|---|
| haberman | 306 | 2 | 1 | 3 | 2 |
| banknote | 1372 | 4 | 0 | 4 | 2 |
| iris | 150 | 4 | 0 | 4 | 3 |
| thyroid | 215 | 5 | 0 | 5 | 3 |
| ecoli | 336 | 7 | 0 | 7 | 8 |
| seeds | 210 | 7 | 0 | 7 | 3 |
| Method | ARI [IQR] | NMI [IQR] | -MAE | |||
| Low | High | Low | High | Low | High | |
| TabClustPFN ∗ | 0.8348 [0.22] | 0.1125 [0.10] | 0.8012 [0.28] | 0.1571 [0.14] | - | - |
| TabClustPFN | 0.8360 [0.24] | 0.1321 [0.08] | 0.8046 [0.32] | 0.1940 [0.10] | 0 | 5 |
| AP | 0.0551 [0.10] | 0.0243 [0.02] | 0.3169 [0.28] | 0.1440 [0.06] | 44 | 45 |
| Agg ∗ | 0.6586 [0.39] | 0.1536 [0.07] | 0.6513 [0.35] | 0.1562 [0.01] | - | - |
| Agg + | 0.6081 [0.46] | 0.1278 [0.09] | 0.6006 [0.40] | 0.1087 [0.04] | 1 | 3 |
| Method | ARI [IQR] | NMI [IQR] | -MAE | |||
| Low | High | Low | High | Low | High | |
| TabClustPFN ∗ | 0.5754 [0.31] | 0.1897 [0.21] | 0.5737 [0.34] | 0.1614 [0.13] | - | - |
| TabClustPFN | 0.4431 [0.29] | 0.1801 [0.14] | 0.5311 [0.28] | 0.1843 [0.16] | 1 | 1 |
| AP | 0.1217 [0.18] | 0.0298 [0.05] | 0.3306 [0.29] | 0.1408 [0.13] | 27 | 40 |
| Agg ∗ | 0.5104 [0.27] | 0.1404 [0.06] | 0.5665 [0.32] | 0.0786 [0.05] | - | - |
| Agg + | 0.5019 [0.37] | 0.1359 [0.11] | 0.4544 [0.34] | 0.0915 [0.06] | 0 | 2 |
| Method | ARI Rank [IQR] | NMI Rank [IQR] |
|---|---|---|
| TabClustPFN* | 1 [4] | 3 [5] |
| Agg* | 8 [4] | 9 [4] |
| Birch* | 8 [5] | 9 [4] |
| GMM* | 6 [7] | 5 [5] |
| KMeans* | 6 [6] | 6 [6] |
| Spectral* | 13 [2] | 13 [1] |
| Aspect | Cluster-PFN | TabClustPFN |
|---|---|---|
| Prior | Finite GMM prior in a low-dimensional setting ( ). | Controlled-overlap GMM prior combined with the ZEUS prior, covering both Gaussian and nonlinear non-Gaussian cluster geometries ( ). |
| Cluster-assignment objective | Uses deterministic relabeling to break label permutation symmetry, followed by cross-entropy. | Optimizes a permutation-invariant SoftARI loss, avoiding deterministic relabeling conventions that can be sensitive to scaling and dimensionality. |
| Cluster-assignment architecture | Uses standard Transformer layers followed by an MLP output head. | Uses a TabICL encoder followed by an iterative prototype–data cross-attention decoder in PIN. |
| Cluster-assignment mechanism | Outputs membership probabilities directly from point embeddings. | Maintains cluster prototypes and computes assignments via cosine similarities between point representations and prototypes. |
| Cardinality-inference architecture | Constructs a special object from a fixed all- vector, concatenates it with dataset embeddings, and maps the decoded representation of to . | Uses CIN to map assignment Gram matrices to a posterior over . |
| Conditioning on | Conditions the model through an embedding of the candidate value of . | Conditions PIN by selecting the first cluster prototypes, so the active prototypes directly define the candidate cardinality. |
| Method | Synthetic ( datasets) | Real-world ( datasets) | ||||
|---|---|---|---|---|---|---|
| ARI | NMI | -MAE | ARI | NMI | -MAE | |
| TabClustPFN | 0.8308 [0.39] | 0.8000 [0.42] | 0 | 0.3853 [0.42] | 0.4237 [0.36] | 1 |
| DP-means | 0.0552 [0.08] | 0.3484 [0.29] | 302 | 0.0351 [0.10] | 0.2767 [0.25] | 138 |
| DP-means † | 0.2892 [0.78] | 0.4340 [0.67] | 3 | 0.2774 [0.41] | 0.3424 [0.36] | 2 |
| Dip-means | 0.0000 [0.00] | 0.0000 [0.00] | 3 | 0.0000 [0.24] | 0.0000 [0.44] | 1 |
| Dip-means † | 0.0000 [0.00] | 0.0000 [0.00] | 4 | 0.0558 [0.39] | 0.1245 [0.48] | 1 |
| OpenML ID | Dataset | |||
|---|---|---|---|---|
| 458 | analcatdata_authorship | 841 | 70 | 4 |
| 12 | mfeat-factors | 2000 | 216 | 10 |
| 46980 | MIC | 1699 | 111 | 8 |
| 14 | mfeat-fourier | 2000 | 76 | 10 |
| 41143 | jasmine | 2984 | 144 | 2 |
| 40966 | MiceProtein | 1080 | 77 | 8 |
| Method | ARI | NMI | -MAE | Time (s) |
|---|---|---|---|---|
| TabClustPFN | 0.200 [0.371] | 0.352 [0.462] | 1 | 0.124 |
| ZEUS+KMeans + | 0.165 [0.441] | 0.327 [0.487] | 5 | 1.363 |
| KMeans + | 0.183 [0.469] | 0.229 [0.523] | 4 | 0.106 |
| Agg + | 0.155 [0.470] | 0.289 [0.545] | 4 | 1.792 |
| HDBSCAN | 0.083 [0.064] | 0.141 [0.319] | 7 | 1.016 |
| CIN loss | Synthetic | Real |
|---|---|---|
| Order-aware | 1.0 | 2.5 |
| CE (Ours) | 0.0 | 1.0 |