TabICL — in-context learning on tabular data, with no gradient step.
tabicl package from Inria's Soda team. TuiML ships no weights; tabicl fetches its own checkpoint on first use, and both its code and its weights are BSD-3-Clause, the same license as TuiML.Classes
Tabular classification by in-context learning, with no training.
__init__( self, n_estimators: int = 8, softmax_temperature: float = 0.9, average_logits: bool = True, outlier_threshold: float = 4.0, batch_size: int = 8, device: Optional[str] = None, allow_auto_download: bool = True, model_path: Optional[str] = None, random_state: int = 42, n_jobs: Optional[int] = None, verbose: bool = False) -> None, )
Overview
- Each column is normalised and outliers are clipped.
- A column-then-row attention stack embeds every cell in the context of
- Training rows and their labels form the context; test rows are
- One forward pass returns a distribution over classes for each test row.
-
Steps 1-4 repeat for
n_estimatorspermutations of the features and
Theory
A conventional classifier searches for parameters \theta minimising a loss on your data. TabICL does not. It approximates the posterior predictive distribution directly, having been pretrained to map a context set onto predictions:
The integral is what a Bayesian method would have to approximate by sampling. Pretraining on millions of synthetic datasets amortises it into the network's weights, so at your dataset the whole thing is one forward pass. This is why the method needs no tuning: the "learning algorithm" was itself learned, once, in advance.
Parameters
n_estimators
softmax_temperature
average_logits
outlier_threshold
batch_size
n_estimators when memory is tight.
device
None lets tabicl choose.
allow_auto_download
model_path
random_state
n_jobs
verbose
Attributes
model_
tabicl.TabICLClassifier.
classes_
y.
n_features_in_
fit.
Notes
Requires pip install 'tuiml[foundation]', which pulls in tabicl and PyTorch. Importing TuiML and constructing this class work without either; only fit needs them.
Weights are not shipped by TuiML. On first use tabicl downloads its checkpoint from the Hugging Face Hub into ~/.cache/huggingface. Code and weights are both BSD-3-Clause, matching TuiML's own license, so there is no commercial-use restriction to accept. That is not true of every tabular foundation model — several publish weights under non-commercial terms — which is why TabICL is the only one integrated here.
Complexity: fitting is O(1) in the sense that matters — no optimisation runs. Prediction is a transformer forward pass over n_{\text{train}} + n_{\text{test}} rows per ensemble member, so cost grows with the training set at predict time. A GPU is worth roughly an order of magnitude.
When to use TabICL:
- Small to medium tabular data (up to roughly 100k rows) where you want a
- As a baseline that costs one line and no search budget.
- When labelled data is scarce — amortised pretraining is at its most
Prefer a gradient-boosted ensemble (XGBoostClassifier) on large data, where TabICL's per-prediction cost stops being worth it.
References
See Also
Constructing and inspecting the model needs no optional dependency:
>>> from tuiml.foundation import TabICLClassifier
>>> clf = TabICLClassifier(n_estimators=2)
>>> clf.n_estimators
2
>>> "softmax_temperature" in clf.get_parameter_schema()
True
Fitting requires pip install 'tuiml[foundation]' and downloads the
checkpoint on first use:
>>> import numpy as np # doctest: +SKIP
>>> rng = np.random.default_rng(0) # doctest: +SKIP
>>> X = rng.normal(size=(60, 4)) # doctest: +SKIP
>>> y = (X[:, 0] > 0).astype(int) # doctest: +SKIP
>>> clf.fit(X, y).predict(X[:5]) # doctest: +SKIP
array([1, 0, 0, 1, 1])
Methods
Tabular regression by in-context learning, with no training.
TabICLClassifier, using the same frozen pretrained transformer and the same one-forward-pass prediction. See that class for the full description of the method; this docstring covers only what differs.__init__( self, n_estimators: int = 8, outlier_threshold: float = 4.0, batch_size: int = 8, device: Optional[str] = None, allow_auto_download: bool = True, model_path: Optional[str] = None, random_state: int = 42, n_jobs: Optional[int] = None, verbose: bool = False) -> None, )
Overview
- Columns are normalised and outliers clipped.
- Column-then-row attention embeds each cell.
- Training rows and their targets form the context; test rows are
- One forward pass returns a predicted value per test row.
-
Steps 1-4 repeat over
n_estimatorsfeature permutations and the
Theory
As in the classifier, the network approximates the posterior predictive distribution rather than fitting parameters to your data:
with a continuous rather than categorical target. There is no class permutation to average over, so the regressor has neither class_shuffle_method nor softmax_temperature.
Parameters
n_estimators
outlier_threshold
batch_size
device
None lets tabicl choose.
allow_auto_download
model_path
random_state
n_jobs
verbose
Attributes
model_
tabicl.TabICLRegressor.
n_features_in_
fit.
Notes
Requires pip install 'tuiml[foundation]'. Importing and constructing work without it; only fit needs it. TuiML ships no weights — tabicl downloads its own checkpoint, BSD-3-Clause like TuiML itself.
Complexity: no optimisation runs at fit time; prediction is a forward pass over training plus test rows, per ensemble member.
When to use TabICLRegressor: small to medium tabular regression where you want a strong untuned baseline. Prefer XGBoostRegressor on large data, and NGBoostRegressor when you need a calibrated predictive distribution rather than a point.
References
See Also
>>> from tuiml.foundation import TabICLRegressor
>>> reg = TabICLRegressor(n_estimators=2)
>>> reg.n_estimators
2
>>> "softmax_temperature" in reg.get_parameter_schema()
False