Skip to content

[New Model] Add TabLDM foundation model - #487

Open
occamsX wants to merge 3 commits into
autogluon:mainfrom
occamsX:feature/add-TabLDM
Open

[New Model] Add TabLDM foundation model#487
occamsX wants to merge 3 commits into
autogluon:mainfrom
occamsX:feature/add-TabLDM

Conversation

@occamsX

@occamsX occamsX commented Aug 31, 2026

Copy link
Copy Markdown

Adds TabLDM: a ~70M-parameter in-context-learning tabular foundation model with a dual-stream column embedder and a sparse Mixture-of-Experts (MoE1) backbone, trained on large-scale synthetic tabular data. Like TabPFN, fit does not update weights; it only preprocesses the context and loads the pretrained checkpoint, and prediction runs through a single forward pass.

Wrapper: models/tabldm/model.py
Codebase: https://github.com/xiaomi-research/xiaomi-tabldm
Checkpoints: https://huggingface.co/occams/Xiaomi-TabLDM
Technical report: not released yet (no paper/BibTeX published upstream).

⚠️ Not yet benchmarked on the cluster

has_raw/has_processed/has_results are all False and verified=False in info.py — no benchmark run exists yet.

Local fit is now verified for binary: a CPU-forced smoke fit (ag_args_fit={"num_gpus": 0}) ran _fit's full path end to end (resource negotiation, preprocessing, model_cls(...).fit(X, y)) for both a single-fold fit + refit and a 2-fold bagged fit (sequential_local fold-fitting) + refit, each completing with a real validation accuracy and no errors. Reaching this point needed two environment fixes, unrelated to the wrapper code: the sandbox sits behind a corporate TLS-intercepting proxy whose CA isn't in the venv's bundled certifi store (fixed by pointing REQUESTS_CA_BUNDLE/SSL_CERT_FILE at the system bundle, which already trusts it), and occams/Xiaomi-TabLDM is a gated HF repo ("gated": "auto"), so the checkpoint download needs an HF token from an account that requested and was granted access. TODO(user): confirm benchmark/CI nodes will have such a token available (e.g., HUGGING_FACE_HUB_TOKEN), since without one the checkpoint download returns 403s regardless of network setup.

Changes

  • models/tabldm/{model,hpo,info,init}.py — the wrapper + ModelInfo (auto-discovered by the registry; method="TabLDM", ag_key="TA-TABLDM", can_hpo=False, verified=False).
  • models/tabldm/_vendor/ — the tabldm inference package (30 files) copied from xiaomi-tabldm, plus enhanced classifier/regressor estimators wrapping the base MoE1 model with an ensemble/calibration pipeline.
  • models/init.py — TabLDMModel added to _LAZY_CLASSES.
  • website/website_format.py — classified as a foundation model.
  • pyproject.toml — tabldm = ["einops"] extra + added to extended.
  • ruff.toml — _vendor/ excluded from lint (vendored code, kept as-imported).

Notes

  • fit ignores X_val/y_val/time_limit (in-context-learning model, no training loop); preprocessing is handled by the vendored estimator itself.
  • Weights and code are Apache-2.0 — no non-commercial restriction, unlike some other recent foundation-model submissions.
  • refit_folds=True + sequential_local fold-fitting (matching TabICL/TabSwift/LimiX): refitting one model on all data gives faster inference at similar quality to a bagged ensemble, and sequential fitting avoids fold contention on the shared HF checkpoint cache.
  • Only the MoE1 architecture (2 routed experts top-1 + 1 shared expert) is supported by the current inference package; the default config uses the vendored estimators' own checkpoints (clf ≈ 70.1M params/reg ≈ 71.1M params).
  • No search space (can_hpo=False) and no warmup() override yet — AbstractTorchModel covers generic torch/CUDA warmup; prefetch_weights() already pre-downloads both checkpoints ahead of the timed fit. TODO(user): decide whether checkpoint prefetch/load should also happen during warmup once a run is possible.
  • No tests/tabarena/models/smoke_configs.py override yet. TODO(user): once the checkpoint download is unblocked and a toy fit is verified, decide whether the default config needs a lighter override.
  • date="2026-08-31" in info.py is a placeholder (today's date, not a run date). verified=False and no suite/cache_kwargs yet — filled in by the upload flow once a benchmark run exists.

@LennartPurucker

Copy link
Copy Markdown
Collaborator

Heyho, very cool, thank you for your contribution!

Can you report back once you have benchmark results for your method? I will then work on integrating the model and confirming your results.

Moreover, I suggest not vendorizing your own model. This is mostly a workaround for when we don't control the model's codebase. Here, please try to keep your model and interface in their own GitHub codebases controlled by you, make them pip-installable, and then install/import them in the PR.

Also, do you have a blog post or documentation on your method?

@LennartPurucker LennartPurucker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very clean otherwise, cool!

# Vendored under `_vendor/` (not on PyPI). Most runtime deps (torch, numpy, scikit-learn,
# scipy, psutil, tqdm, huggingface_hub) are already in TabArena's base tree, but `einops`
# (used by `_model/rope.py`) is not, so it is the one real extra dependency.
pip_extra=("einops",),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add the install of your own package here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree. I am currently removing the _vendor/ directory. I have set up the standalone inference package in my own repository and will add it to pyproject.toml via "git+https://github.com/xiaomi-research/xiaomi-tabldm.git@3090d4f3da420e25a482bead97c9fe061607bffb" to ensure reproducibility.

self.model = model_cls(device=device, n_jobs=num_cpus, **hps)
self.model.fit(X, y)

def _predict_proba(self, X: pd.DataFrame, **kwargs) -> np.ndarray:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure you need this function, the default wrapper should to about the same

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are absolutely right. I was over-engineering the _predict_proba(). I have removed the custom overrides and will rely entirely on the default AbstractTorchModel implementation to keep the wrapper clean.

@occamsX

occamsX commented Sep 2, 2026

Copy link
Copy Markdown
Author

Update since opening this PR — three things changed upstream/environment-side, plus a local validation run:

1. Switched from vendored code to a real pip dependency.
xiaomi-research/xiaomi-tabldm now ships a proper pyproject.toml (pip name Xiaomi-TabLDM, import name tabldm), so models/tabldm/_vendor/ (the 30 copied files) is dropped entirely. The wrapper now imports the installed package directly (from tabldm import TabLDMEnhancedClassifier / TabLDMEnhancedRegressor), pinned to commit 3090d4f3da420e25a482bead97c9fe061607bffb via a git+https://... dependency, kept in sync between pyproject.toml's tabldm extra and info.py's pip_extra. ruff.toml's vendor-exclude line for tabldm is removed since there's no vendored tree left to exclude.

2. Renamed the model end-to-end: TabLDMXiaomi-TabLDM.
Matches the naming convention other TabArena-wrapped foundation models use (e.g. SAP-RPT-OSS, TabSwift): method/display_nameXiaomi-TabLDM, ag_keyTA-XIAOMI-TABLDM, ag_nameTA-Xiaomi-TabLDM, model_keyXIAOMI-TABLDM, config_defaultXiaomi-TabLDM_c1_BAG_L1. Updated website_format.py's foundation-model prefix list and rename map (TABLDMXIAOMI-TABLDM) to match.

3. The HF checkpoint repo is no longer gated.
occams/Xiaomi-TabLDM now reports gated: false, private: false via the HF API. This resolves the open question from the original PR body about whether benchmark/CI nodes would have a granted HUGGING_FACE_HUB_TOKEN — checkpoint download now works anonymously, no token needed.

4. Ran the TabArena-v0.1 "lite" subset locally, end to end.
tmp_scripts/run_Xiaomi-TabLDM.py setup + eval against all 51 real v0.1 datasets (one fold/repeat each — 51 fits + 51 refits), covering binary (30), multiclass (8), and regression (13). All 51 completed with no errors; mean train time ≈97s/task, mean inference time ≈5s/task. In the lite-subset leaderboard comparison (85 entrants): Elo 1580, win rate ≈80%.

  • This lite run is a pipeline sanity check on real data, not a benchmark-grade result, so has_raw/has_processed/has_results/verified stay False in info.py

  • Also added a tests/tabarena/models/smoke_configs.py override (n_estimators=1) so the registry-driven smoke-fit test stays fast now that the checkpoint fetch is unblocked.

Full TabArena-v0.1 (816-task) cluster run + upload via the upload-method flow — this lite run only exercises 51/816 tasks. A full report covering that run is being prepared and will be shared on this PR once it's ready.

@occamsX

occamsX commented Sep 4, 2026

Copy link
Copy Markdown
Author

@LennartPurucker Apologies for the extra commit here. The upstream Xiaomi-TabLDM HF checkpoint(occams/Xiaomi-TabLDM) was updated with 4 new MoE hyperparameters that the previously pinned commit didn't support, so loading the classifier checkpoint failed with a TypeError. This bumps the pin to the upstream fix commit (6773a30) that adds support for these parameters, keeping the wrapper aligned with the latest published checkpoint. Verified both classifier and regressor checkpoints load successfully after the bump.

@LennartPurucker

Copy link
Copy Markdown
Collaborator

Very cool, thank you for your effort @occamsX!

I will add this to my TODO list for next week to run the model and get it on the leaderboard by the 13th of September.
Your changes look good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants