Tabular Fm Studies
ASecurityDated reference and tested scripts for studies with tabular foundation models (TabICL, TabPFN, TabDPT, prior-fitted and in-context models) as of October 2026. Use it whenever someone samples synthetic tables from a TabICL prior, extracts dataset or row embeddings from a frozen tabular model, loads TabArena or BeyondArena, reads their published per-dataset results, computes PyMFE or Dataset2Vec meta-features, or compares synthetic priors with real tables, even when they only say "the prior", "...
- 2 stars
- 0 votes
- 0 copies
- 3 views
- Added November 27, 2026
Works with
Security analysis
92/100- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 20 files and shows the line behind each finding
npx -y skills add EliHei2/scicraft --skill tabular-fm-studies --agent claude-codeAre you the author of Tabular Fm Studies?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/elihei2-tabular-fm-studies)---
name: tabular-fm-studies
description: Dated reference and tested scripts for studies with tabular foundation models (TabICL, TabPFN, TabDPT, prior-fitted and in-context models) as of October 2026. Use it whenever someone samples synthetic tables from a TabICL prior, extracts dataset or row embeddings from a frozen tabular model, loads TabArena or BeyondArena, reads their published per-dataset results, computes PyMFE or Dataset2Vec meta-features, or compares synthetic priors with real tables, even when they only say "the prior", "embed these tables" or "is TabICL better here". Holds what agents get wrong: library defaults that silently changed a prior, output that depended on the hash seed, hooks corrupted by in-place writes, label-aware embeddings read as label-free, AMP drift between devices, suites counted twice, imputed result rows, unbinned regression targets. Prefer distribution-comparison for the two-sample statistics, representation-probes for validating an encoder, ml-evaluation for benchmark tables.
---
# tabular-fm-studies
**This is a snapshot of October 2026 from one project. Libraries change; verify every interface against the
current documentation before relying on it.** It holds what the author's notes record about calling tabular
foundation models, sampling their synthetic priors, gathering real benchmark tables and comparing the two, each
fact with its date and status. It was distilled from one intensive study that embedded about 150 real benchmark
tables and several hundred prior tables with frozen models and meta-feature libraries and compared the two corpora.
General method lives in `distribution-comparison` and `representation-probes`; only what is specific to tabular
models is here.
Status tags used everywhere: **[run]** measured by running code on 2026-10-08; **[doc]** read in installed source,
documentation, papers or published files on 2026-10-08; **[notes]** a project decision, not separately verified;
**[rerun]** reproduced with this skill's scripts in November 2026 on the same pinned stack.
> **PRIME DIRECTIVE: trust no default and no brief. Pin the version, pass every setting of the recipe that made
> the artifact you compare against, and prove determinism and label awareness on a toy table before the first
> real run.**
Three failures cost the most time in the original study. Guard against them from the first hour:
1. **A library release silently changed the object of study.** tabicl 2.2.0 made the v1 prior non-causal and its
graph prior defaults skip the stage-1 filters; nothing in the changelog said so (section 2).
2. **An embedding that was not what it seemed.** Un-cloned hooks recorded tensors the model later edited in place,
a hook's return value replaced a module output, AMP made two devices disagree, and v2 vectors carried the labels
(section 3).
3. **A corpus counted twice, a result table read raw.** 49 of 51 TabArena datasets sit inside BeyondArena, and
published results contain imputed rows (sections 4 and 7).
## 0. Before starting
Collect by reading the project; ask only for what cannot be found, in one message:
- **The question and its unit.** Which tables are compared with which, and whether the unit is a table (dataset
descriptions, coverage, performance link) or a row (predictions).
- **Every input written by someone else**, especially a brief generated by another model. Save it verbatim, then
write a claim-by-claim verdict table (claim, verdict: true, partly wrong, wrong, overstated, changed in version X,
evidence) before building. In the study, a chat-written brief was wrong about the "Mind the Gap?" features, its
corpora, Dataset2Vec weights ("none exist": five checkpoints did), the prior's categorical encoding and the v1
prior defaults [notes].
- **Hardware and compute rules.** Which GPU, whether a hosted notebook is used, and the author's standing rule:
never train a torch model on a CPU (references/environment-and-traps.md).
- **License constraints**: non-commercial weights (TabPFN 2.5 and later, Dataset2Vec), gated models, unlicensed code.
- **The strongest available model**, including local checkpoints the user has access to. The author asked why a
newer fast checkpoint was not used instead of the public one.
## 1. Set up and verify the stack
- **Pin the stack the recipes were verified on**: tabicl 2.2.0, torch 2.14.1, numpy 2.5.3, pandas 3.0.6,
scikit-learn 1.9.1, pymfe 0.4.4, tabdpt 1.3.1 (`--no-deps`), tabpfn 9.1.0, openml 0.15.1, data-foundry 0.0.5,
huggingface_hub 2.1.1 [run]. Full table and install traps in references/environment-and-traps.md.
- **Never guess an API.** Read the installed source, note version and signature, log every surprise as a gotcha
with its fix. Keep the notes to four lists: verified signatures, deviations from papers, key decisions, measured
runtimes [notes]. `tabicl.__version__` does not exist; use `importlib.metadata.version("tabicl")` [run].
- **Do not install the `tabarena` package**: it pulled autogluon and ray and downgraded pandas 3.0.6 to 2.3.3. Its
result files are plain parquet over HTTP [run].
- **Install conflicting model packages without touching the core stack**: `pip install --no-deps tabdpt==1.3.1
"faiss-cpu<1.13" omegaconf` (it pins `huggingface-hub<2.0` and works with 2.1.1) [run].
- **Run the ten-minute check** on every new machine, environment or release, before any study run:
```bash
python scripts/verify_stack.py # versions, prior determinism and hash seed, v1 causal default,
# hook shapes and clone, label awareness, row order, repeatability
```
On the pinned stack it printed 9 pass, 0 fail, 2 info in 94 s on a laptop CPU [rerun].
## 2. Sample the prior
Recipes, defaults, outputs and runtimes are in references/prior-sampling.md; `scripts/sample_prior.py` implements
them.
- **v1 = `mix_scm` with `is_causal` restored.** tabicl 2.2.0 (PR #135, 2026-07-06) set
`DEFAULT_FIXED_HP["is_causal"]=False`; default tables then have nearly independent features (mean off-diagonal
abs r 0.025 against 0.12 with it sampled as in 2.1.1 and earlier) [run; rerun 0.025 against 0.136]. Pass
`scm_fixed_hp` without `is_causal` and `scm_sampled_hp` with `is_causal: meta_choice [True, False]`.
- **v2 = `graph_scm` with the stage-1 `PriorConfig`**: `add_gaussian_noise=False, filter_unpredictable_graphs=True,
filter_unpredictable_datasets=True, allow_act_warping=False, min_n_nodes=2, max_n_nodes=32,
cauchy_dag_offset=0.0`. `PriorConfig()` turns both filters off, so y can be independent of X [doc].
- **Stage-1 settings**: at most 10 classes, 1024 rows (`min_seq_len=None`), at most 100 features; v1 2 to 100
features and train fraction 0.1 to 0.9, v2 1 to 100 and 0.3 to 0.9 [doc].
- **One table per call, `n_jobs=1`, parallel across tables in your own pool.** `n_jobs != 1` crashed the SCM priors
(closures do not pickle) and deadlocked `graph_scm` on macOS; forked workers would share RNG state [run].
- **Seed numpy, `random` and torch before every table**, and patch the v2 generator's set iteration with `sorted`:
unpatched, one seed gave 2 different tables across `PYTHONHASHSEED` 0 to 5; patched, 1 [run, rerun].
- **Disjoint seed ranges per purpose** (v1 evaluation 1,000,000; v2 evaluation 2,000,000; encoder training
11,000,000 and 12,000,000), so evaluation tables never train anything [notes].
- **Record each table's hyperparameters**: the library returns none. Wrapping `generate_dataset` captures the v1
hyperparameters (36 columns); for v2 only the feature count, class count and row count pass through it [rerun].
- **Know what the prior emits**: clamp at inlier mean plus or minus 4 SD before the final z-score (abs x up to 22),
rare-category columns with SD below 1, categoricals as unflagged z-scored codes, non-contiguous graph labels
(re-encode with `np.unique(..., return_inverse=True)`), graph y int64 against SCM float32 [run].
- **Label the outputs and the deviations**: v2 "port not experimentally verified (PR #135)"; `batch_size_per_gp=1`
instead of the scripts' 4 (tables i.i.d. instead of groups of four sharing hyperparameters, not weights).
```bash
python scripts/sample_prior.py --prior v1 --seeds 1000000:1000500 --out prior_v1 # 0.3 to 1.3 s per table
python scripts/sample_prior.py --prior v2 --seeds 2000000:2000500 --out prior_v2
python scripts/sample_prior.py --prior v2 --seeds 2000000:2000100 --regression --out prior_v2_reg
```
## 3. Call the models
Details, module trees, hook shapes and timings are in references/model-interfaces.md.
| Family | Context and size limits | Labels | Preprocessing | Precision and device | Cross-validation |
|---|---|---|---|---|---|
| TabICL 2.2.0 v2 | stage-1 tables were 1024 rows, at most 100 features, at most 10 classes; more classes use mixed-radix ensembling | v2 label-aware at every stage; v1 and v1.1 column and row stages label-free | estimator scales and power-transforms on train rows; feed the canonical copy, regression binned for the classifier | `use_amp=False`; pass `device` (None auto-picks MPS); fp32 MPS against CPU 9e-7 | its own CV score cost most of the runtime; run it only on clean real tables where an analysis uses it |
| TabDPT 1.3.1 | 16 classes on the standard path; PCA above 128 features; 64 learned rows | label-aware from layer 1 | canonical copy, `X.astype(np.float32)` | float32 on MPS, `compile=False, use_flash=False` off CUDA | none used |
| TabPFN 9.1.0 | CPU guard above 1000 rows (`ignore_pretraining_limits=True`) | train-row embeddings hold their own label token | canonical copy | MPS 3 to 4 times faster than CPU | `TabPFNEmbedding(n_fold=...)` for out-of-fold row embeddings |
| Dataset2Vec (released weights) | subsamples of 256 rows x 16 features x 3 class columns | label-blind (0.0005 to 0.001 of the between-table spread) | z-scored X, one-hot classes, regression binned | CPU fine for inference | none |
- **Hooks store `.detach().clone()` and return None.** TabICL adds label embeddings to the `row_interactor` output
and writes CLS tokens into the `col_embedder` output in place; without the clone a label-free model showed a
spurious 1.4 % label effect; a hook returning `dict.setdefault(...)` replaced the module output [run, rerun].
Both fixes are needed: rerun on the v1.1 checkpoint, the label effect was 1.43 % with neither, 1.33 % with the
clone alone (the hook returned its clone, so the model wrote into it), and 0.0 with both. A mean-only pooled
check hides the bug, because the mean of the added label embeddings does not change under a label shuffle; pool
the standard deviation too, or compare per row [rerun].
- **Exclude the 4 reserved CLS slots** at `col_embedder[:, :, :4]` (placeholders of about plus or minus 100) [run].
- **Hooks fire once per normalization-method batch**: concatenate along dim 0 [run].
- **Pool over the training rows and predict one query row**: test rows never change train-row tensors [run].
- **Average over ensemble members or permutations**: column order is not invariant (0.18 at 1 member, 0.09 at 4);
row order is, to float error (4.5e-7; tests use a tolerance) [run; rerun 9.0e-7].
- **Load the checkpoint once per process**: every `fit()` reloads it (0.3 to 0.7 s) [run].
- **Say whether an embedding contains the target before showing it.** For label-aware models write `task`, `null`
(mean over label shuffles defined on row content) and `delta = task - null`; keep the TabICL v1.1 view as a
label-free control (rerun: a label shuffle moved v2 by 0.56 and v1.1 by 0.0). The author's first question about
any embedding was "are these with target or without target?".
- **Follow the released code when paper and code disagree**, and tabulate the differences: the Dataset2Vec paper
says 45,424 parameters and 64-d, the released weights are 75,072 and 32-d [doc].
- **Prove a reimplementation against the authors' published outputs**: the Dataset2Vec port matched the published
meta-features with per-dimension r = 1.0000 on 63 datasets, and again when rerun from the documented snippet [run].
- **Never give a substitute the original's name**: the PyPI `dataset2vec` package is a different model [notes].
```bash
python scripts/dataset_vectors.py tables/*.npz --encoders tabicl,tabicl_v11,tabdpt,tabpfn,pymfe --out vectors/ --device cpu
python scripts/d2v_embed.py tables/*.npz --out vectors/d2v.csv --cache weights_cache/ --label-check
```
## 4. Gather real tables
Loaders, counts, sizes and licenses are in references/corpora-and-results.md.
- **TabArena**: `openml.study.get_suite("tabarena-v0.1")`, study 457, 51 tasks (38 classification, 13 regression)
[doc]. Drop `string` features (7 datasets have them, one a date stored as text) and count the drop [run].
- **BeyondArena**: `from data_foundry.collections import BEYOND_ARENA`, 142 datasets (103 IID, 21 temporal, 18
grouped), 11.07 GB [run]. **Drop the `group_on` column, which stays in the DataFrame, and the `time_on` column**;
record each dataset's regime [run].
- **Deduplicate before counting or pooling.** 49 of 51 TabArena datasets are in BeyondArena: about 144 unique real
tables, not about 190; the overlap count is read from the published lists [doc]. Match normalized names first:
they caught only 40 of the 49, and the 9 renamed ones each had a unique identical row count [rerun]. Confirm
every candidate by identical row and column counts, check the rest by eye (4 of the 40 name matches differed by
1 to 965 rows on the public index files [rerun]), and keep the mapping in a file.
```bash
python scripts/published_results.py overlap tabarena.csv beyondarena.csv --col-a name --col-b dataset \
--rows-a n_rows --rows-b n_rows --cols-a n_features --cols-b n_features --out overlap.csv
```
- **Check licenses per dataset** (BeyondArena: CC BY 66, public domain 28, Kaggle rules 17, non-commercial 9, not
stated 9, others) and keep a license column [doc].
## 5. Equal budget and the canonical copy
The procedure and the trivial channels are in references/preprocessing-and-metafeatures.md.
- **Same budget for every table**: at most 1024 rows (seeded, stratified, at least one row per class) and 100
features; synthetic tables have exactly 1024 rows; keep the original size as metadata. "Without this, 'real vs
synthetic' is mostly 'big vs 1024 rows'" [notes].
- **A seeded random subsample, never the first rows** [doc].
- **The canonical copy for every table, synthetic included**: ordinal codes, the prior's 4-SD inlier clamp and
z-score (clip 100), NaN to 0, no categorical flags. The numpy port matched tabicl to 4.8e-7 [run].
- **Bin regression targets into 10 quantile classes with ties to the lower bin** for every classifier-only encoder
(TabICL classifier, TabDPT, PyMFE, Dataset2Vec), so zero-inflated targets keep 2 or more classes [notes, rerun].
- **Strip trivial channels level by level** before claiming a gap: size, dtype typing, NaN patterns, asymmetric
target handling, row order, categorical flags [doc, notes].
```bash
python scripts/canonical_table.py table.parquet --target y --drop-cols group_id,date --max-rows 1024 \
--max-features 100 --bin-target 10 --out tables/name.npz --check-tabicl
```
## 6. Dataset-level descriptions
- **PyMFE gives one feature list only with prepared input**: impute first (NaN turned 43 of 48 statistical outputs
into NaN), bin the target (a continuous y removed the model-based group from the name list), pass `cat_cols=[]`,
reindex to a fixed name list. The fast profile (general, statistical, info-theory, model-based) gives 97 outputs
in about 1.2 s per table [run, rerun]. The timing option is `measure_time`; `timeopt` does not exist [doc].
- **Port the "Mind the Gap?" 70-d vector exactly from its code**, including dtype typing, pandas skew and kurtosis,
30-bin cumulative histograms and abs r > 0.7; its code has no license, so port the ideas and copy nothing [doc].
- **Verify every description on a toy table**: fixed output length across a binary and a multiclass table, finite
values, the label-shuffle shift, row-order invariance, bitwise repeatability [run].
- **Check the newest literature before fixing a feature set.** The author asked why a recent meta-feature paper was
missing from the first sweep.
## 7. Published results and the performance link
- **Read per-dataset results from TabArena's `hpo_results.parquet` per method** (36 to 82 KB; URLs in
references/corpora-and-results.md). `data.tabarena.ai` returned 403 to urllib's default User-Agent [run].
- **Drop imputed rows**: TabICL v1 is RF-imputed on 15 of 51 datasets, TabPFNv2 on 18 [doc].
- **Average over folds per dataset, compare on shared datasets, use a scale-free gap**
`log(err_best_tree / err_fm)` because the metric differs by task type [notes].
- **Check the download against a known headline**: TabICLv2 default beats CatBoost tuned+ensembled on 42 of 51
[doc; rerun 42/51]. BeyondArena ran TabPFN-2.6 and TabDPT only up to 100k training rows (120 of 142) [doc].
```bash
python scripts/published_results.py tabarena --cache results_cache/ --out gap_tabarena.csv
```
## 8. Evaluation hygiene for tables
Reasons and examples are in references/evaluation-hygiene.md.
- **State the detectable effect size before correlating over datasets**: n = 51 detects abs r of about 0.38,
n of about 144 about 0.23. Report a null as a null [doc, notes].
- **Keep derived copies of a table out of every fit and every test** (row chunks, zero-rate ladders, perturbed and
shuffled copies); project them only [notes].
- **Aggregate per dataset before crossing datasets**; fold counts differ by size (9 or 30 in TabArena) [doc].
- **Separate "the encoder knows the prior" from "the data differ"** with encoders trained on the prior and on real
tables (TabICL and TabDPT; retrained and released Dataset2Vec) [notes].
- **Report every non-default setting where the result is reported**, and label each component exact reproduction,
approximate reproduction or new extension [notes].
- **Fit scaling and PCA on a balanced clean reference** (all real plus an equal synthetic subset, at least 30) and
compute no number from UMAP coordinates [notes].
## 9. Check before handing over
1. `scripts/verify_stack.py` on the machine that produced the results: zero FAIL; every version line that differs
from the pins explained.
2. Every script exits 0 and its counts match expectation: tables written, drops counted, failures listed.
3. Fixed vector length per view across tables; no NaN in learned views; PyMFE NaN columns handled by the cleaning
rules in references/preprocessing-and-metafeatures.md.
4. The result download reproduces its headline (42/51) before any gap is used.
5. Look at the numbers: the v1 mean abs r near 0.12, not 0.025; the label effect of v2 about 0.5 and of v1.1 0;
max abs x of graph tables above 4. A value at the other end means a recipe was not applied.
6. Say what was not checked: weights not downloaded, a GPU path not run, BeyondArena files skipped by size, the
Dataset2Vec published-output comparison not rerun, and every fact taken from this October 2026 snapshot without
re-reading the current source.
## 10. What was thrown out, and what replaced it
| Thrown out | In the author's words or the notes | Replaced by |
|---|---|---|
| building straight from a chat-written spec | "please do your own research" | a claim-by-claim verdict table first |
| package defaults for the v1 prior | "changed in 2.2.0" (verdict table) | the stage-1 recipe passed explicitly, `is_causal` restored and labeled |
| `PriorConfig()` defaults for v2 | filters "set to False" by default | the stage-1 filters on |
| `n_jobs` inside the generator | crashed or deadlocked | one process per generator, own pool |
| hooks that store without cloning, hooks that return a value | "silently corrupted the results" | `.detach().clone()`, return None |
| AMP on a GPU | CPU and GPU shards disagreed by 2e-3 | `use_amp=False` everywhere |
| an embedding shown without saying what it encodes | "are these with target or without target?" | task, null, delta views and a label-free control |
| the PyPI `dataset2vec` package | "Not faithful; do not call it Dataset2Vec" | the code-faithful port with released weights |
| "no pretrained Dataset2Vec weights exist" | five checkpoints existed | weights downloaded at run time, never redistributed |
| the `tabarena` package for result files | it downgraded pandas and pulled autogluon and ray | plain HTTP parquet files |
| TabArena next to BeyondArena | "drop tabarena, because it's part of beyondarena" | deduplicated corpus with an overlap flag |
| the first 512 rows of a table | biases sorted tables | a seeded stratified subsample |
| the convenient public encoder | the author asked why the newer fast checkpoint was not used | the strongest available model, selected by a path |
| a derived variant with no account of how it was built | "how do you go from 95% of zeros to 50%?" | each variant's construction written where it is shown |
## 11. What stayed open
The reason for the 2.2.0 v1 change, mix_scm NaN behavior, TabDPT's pretraining overlap
with TabArena, the conflicting literature on prior coverage and performance, and the planned priors that never ran
are listed in references/open-questions.md. The study's full-run results were never read, so this skill holds
method and interfaces, not findings.
## Scripts
All take `--help`, print what they checked and exit non-zero on failure. numpy and pandas everywhere; the rest as
named. Each was run in November 2026 on the pinned stack (build note lists inputs).
| Script | Does | Needs |
|---|---|---|
| `scripts/verify_stack.py` | the ten-minute check of section 1 | tabicl 2.2.0, torch; downloads two checkpoints |
| `scripts/sample_prior.py` | v1, v1 2.2.0 default, v2 prior tables with hyperparameters and content hashes | tabicl 2.2.0, torch |
| `scripts/canonical_table.py` | encode, budget, canonical copy, binned target; optional comparison with tabicl | pandas; tabicl for `--check-tabicl` |
| `scripts/dataset_vectors.py` | TabICL task/null/delta, TabICL v1.1, TabDPT, TabPFN v2, PyMFE vectors | per encoder package |
| `scripts/d2v_embed.py` | Dataset2Vec vectors from the released weights, no TensorFlow | torch; network once |
| `scripts/published_results.py` | suite overlap with rename candidates and row and column checks, kept as a mapping file; TabArena per-dataset gap | network once for `tabarena` |
## Reference files
- `references/environment-and-traps.md`: the pinned stack, install traps, every runtime trap with symptom, cause,
fix and status, the compute rules.
- `references/prior-sampling.md`: PriorDataset API, defaults, stage-1 recipes, determinism, groups, output format
and preprocessing order, hyperparameter capture, runtimes, caveats to quote.
- `references/model-interfaces.md`: comparison table of candidates, TabICL module tree and hooks, label awareness,
invariances and timing, the "Mind the Gap?" extraction, TabDPT, TabPFN, Dataset2Vec, toy-panel probe numbers.
- `references/corpora-and-results.md`: TabArena and BeyondArena loaders and counts, overlap, published result
files and their columns, imputed rows, building the per-dataset gap, licenses.
- `references/preprocessing-and-metafeatures.md`: equal budget, canonical copy, binned targets, trivial channels,
PyMFE rules and timings, the exact 70-d vector, meta-feature cleaning, replicating a meta-feature paper.
- `references/evaluation-hygiene.md`: the dataset as unit, effect sizes, per-dataset aggregation, derived copies,
seeds, the 2 x 2 over encoder training data, reporting.
- `references/open-questions.md`: unverified facts, partial work, conflicting literature, next steps never run.
- `THIRD_PARTY.md`: the tabicl code copied or ported (BSD 3-Clause notice), the Dataset2Vec port and its
non-commercial weights, and the other borrowed pieces.
Files in this skill
- SKILL.md
- THIRD_PARTY.md
- evals/hook-debug/case.yaml
- evals/hook-debug/files/embed_tables.py
- evals/hook-debug/graders/01-hooks-clone.md
- evals/hook-debug/graders/02-hooks-return-none.md
- evals/hook-debug/graders/03-amp-off-device-explicit.md
- evals/hook-debug/graders/04-cls-slots-excluded.md
- evals/hook-debug/graders/05-all-hook-calls-kept.md
- evals/hook-debug/graders/06-train-rows-only.md
- evals/hook-debug/graders/07-label-aware-scope-and-not-run.md
- evals/hook-debug/place-files.sh
- evals/hook-debug/prompt.md
- evals/pool-two-suites/case.yaml
- evals/pool-two-suites/files/beyondarena.csv
- evals/pool-two-suites/files/tabarena.csv
- evals/pool-two-suites/graders/01-overlap-about-144-unique.md
- evals/pool-two-suites/graders/02-renamed-datasets-handled.md
- evals/pool-two-suites/graders/03-imputed-rows-and-folds.md
- evals/pool-two-suites/graders/04-scale-free-gap.md
Attribution
Related skills
View all in data →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.