Lattice-MT

A tabular foundation model for joint multi-target prediction. Lattice-MT takes labeled context rows and predicts targets for query rows from the same feature table. It supports classification and regression targets in the same call and shares computation across targets within each group. Inference uses frozen pretrained weights.

Source code · Technical report

Checkpoint

This repository provides the 18.0M-parameter FP32 checkpoint used in the technical report.

File Contents
lattice-mt.pt PyTorch checkpoint (72.08 MB)
config.json Checkpoint filename and SHA-256

Quick start

The Lattice-MT Python package requires Python 3.11 or later and PyTorch 2.7 or later. Install the PyTorch build for your hardware and then install the package from GitHub.

git clone https://github.com/hachure-ai/Lattice-MT.git
cd Lattice-MT
python -m pip install .

The first fit downloads and caches the checkpoint. If the checkpoint requires authentication, sign in with hf auth login or set HF_TOKEN with read access. For offline inference, pass model_path="/path/to/lattice-mt.pt" to LatticeMT.

The example predicts a class label and a numeric value for each query row.

import numpy as np

from lattice_mt import LatticeMT

rng = np.random.default_rng(7)
X = rng.normal(size=(40, 5))
X_context, X_query = X[:32], X[32:]
y_context = np.empty((len(X_context), 2), dtype=object)
y_context[:, 0] = np.where(X_context[:, 0] > 0, "high", "low")
y_context[:, 1] = X_context[:, 1] - X_context[:, 2]

model = LatticeMT(
    target_types=["classification", "regression"],
    target_names=["level", "amount"],
    group_size=2,
).fit(X_context, y_context)

result = model.predict_multi_target(X_query)
print(result.prediction.shape)            # (8, 2)
print(result.target_matrices[0].classes)   # Class labels in probability-column order
print(result.target_matrices[0].values)    # Class probabilities, shape (8, 2)
print(result.target_matrices[1].values)    # Regression point predictions, shape (8, 1)

result.prediction follows the input target column order. predict_multi_target also returns class probabilities in target_matrices and regression quantile predictions in quantiles keyed by target name. Use predict(X_query) for the prediction matrix alone. Python API and examples

Target groups

group_size sets the maximum number of targets predicted together. The same checkpoint supports 1, 2, 4, 8 (the package default), and "all". Every ensemble member predicts every target. With 1, each group contains one target. With "all", each member predicts all targets in a single group.

The technical report evaluates group sizes 2, 4, 8, and "all". At the report's selected setting of 2, Lattice-MT reaches 83.36% Hamming score and 65.87% macro-F1 across 25 multi-dimensional classification datasets, and 0.5004 aRRMSE across 18 multi-target regression datasets. Technical report, Table 8

Citation and license

If you use this checkpoint, cite Lattice: From Tabular Foundation Models to General-Purpose Predictive Systems. arXiv:2612.02229 · BibTeX

The checkpoint is licensed under CC BY-NC 4.0. The inference code is licensed under Apache 2.0. Checkpoint license · Code license

Downloads last month
7
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for hachure-ai/Lattice-MT