Other
tabular
foundation-model

Add metadata, paper link, and improve model card

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +75 -293
README.md CHANGED
@@ -1,323 +1,105 @@
1
- # 1. Model Introduction
2
-
3
- **LimiX** is a new class of tabular AI model designed to overcome one of modern machine learning’s longest-standing bottlenecks: structured data. With only **2M parameters**, **LimiX-2M** sets a new state-of-the-art across classification, regression, and missing-value imputation, surpassing XGBoost, CatBoost, AutoGluon, and TabPFN, and approaching the performance level of the larger LimiX-16M. Its lightweight, training-free design makes advanced tabular modeling accessible on ordinary hardware while preserving full transparency and offline deployability.
 
 
 
 
4
 
5
- ![](images/image.png)
6
 
 
7
 
 
 
8
 
 
9
 
 
10
 
11
  **Key Features**
12
 
13
- **Unified Tabular Reasoning**
14
-
15
- End-to-end designed for multi-task tabular intelligence, enabling a single model to handle classification, regression, and imputation without additional tuning, preprocessing, or task-specific fine-tuning.
16
-
17
- **Training-Free, Context-Driven Inference:**
18
-
19
- Operates directly through context learning: no training, no hyperparameters, no preprocessing pipelines. LimiX automatically interprets and processes raw tabular inputs for immediate use.
20
-
21
- **Lightweight & Efficient Deployment:**
22
-
23
- A compact 2M-parameter architecture enables fast inference and smooth operation on standard CPUs and laptops, dramatically reducing compute requirements for advanced tabular modeling.
24
-
25
-
26
-
27
- # 2. Model Architecture & Pretraining Procedures
28
-
29
- LimiX adopts a 12-block transformer architecture with axis-wise attention to features and samples, supported by pre-normalized LayerNorm for stable scaling. The LimiX-16M variant uses an asymmetric design, two feature-axis passes and one sample-axis pass per block, to strengthen feature interaction modeling in heterogeneous schemas with minimal overhead.
30
-
31
- To learn the joint distribution of tabular variables, LimiX is pretrained through Context-Conditional Masked Modeling (CCMM). By masking table cells and conditioning predictions on a small set of context rows, the model internalizes a wide range of conditional dependencies while adapting to new datasets without training or labels.
32
-
33
- ![](images/image-5.png)
34
-
35
- # 3. Evaluation Results
36
-
37
- ## Classification
38
-
39
- ![](images/image-4.png)
40
-
41
- On the BCCO-CLS benchmark, LimiX-16M establishes leading performance by significantly outperforming AutoGluon and all PFN variants in mean AUC, Accuracy, and F1 scores, with substantially better ranks. LimiX-2M also marks a clear lead over these models in most metrics, except for its AUC rank.
42
-
43
- ## Regression
44
-
45
- ![](images/image-3.png)
46
-
47
- LimiX-16M achieves the best overall scores and rankings on TALENT-REG, with the PFN models and LimiX-2M emerging as close runners-up in both R² and RMSE.
48
-
49
- ## Missing Value Imputation
50
-
51
- LimiX introduces the first training-free, in-context approach for missing-value imputation on entirely new datasets. Across a wide set of real-world benchmarks, LimiX-16M delivers the best performance, achieving lower RMSE and error rates than classical and learned imputers including KNN, MICE, MissForest, GAIN, and MIWAE. Unlike all prior methods, which depend on additional fitting, LimiX performs imputation directly from context with consistently superior accuracy.
52
-
53
- ![](images/image-1.png)
54
-
55
- ## Finetune
56
-
57
- Using an attention-based retrieval–guided downsampling strategy, LimiX-16M fine-tunes on compact, highly relevant in-context episodes rather than full long contexts, substantially improving sample efficiency and reducing training cost. This approach enables LimiX-16M to significantly outperform strong baselines such as TabDPT and TabPFN-v2, with notable AUC gains across BCCO-CLS datasets.
58
-
59
- ![](images/image-2.png)
60
-
61
- # 4. Deployment
62
 
63
- 1. **Environment Preparation**
64
 
65
- * Recommended to deploy with Docker. Download the [Dockerfile](https://github.com/limix-ldm/LimiX/blob/main/Dockerfile) from the repository and execute the following command to build the image:
66
 
67
- ```bash
68
- docker build --network=host -t limix/infe:v1 --build-arg FROM_IMAGES=nvidia/cuda:12.2.0-base-ubuntu22.04 -f Dockerfile .
69
- ```
70
 
71
- * For manual deployment, install dependencies:
 
 
 
 
 
 
72
 
73
- ```bash
74
- # Download precompiled flash_attn file
75
- wget -O flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whl https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.0.post2/flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whl
76
- # Install basic dependencies
77
- pip install python==3.12.7 torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1
78
- pip install flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whl
79
- pip install scikit-learn einops huggingface-hub matplotlib networkx numpy pandas scipy tqdm typing_extensions xgboost kditransform hyperopt
80
- ```
81
 
82
- 2. **Model Download**
 
83
 
84
- * Download model weights via Hugging Face Hub:
 
85
 
86
- ```python
87
- from huggingface_hub import hf_hub_download
88
- model_file = hf_hub_download(repo_id="stableai-org/LimiX-16M", filename="LimiX-16M.ckpt", local_dir="./cache")
89
- ```
90
 
91
- ***
 
 
92
 
93
-
94
-
95
- # 5. Model Usage
96
-
97
- 1. **Classification Task Example**
98
-
99
- ```python
100
- from sklearn.datasets import load_breast_cancer
101
- from sklearn.metrics import accuracy_score, roc_auc_score
102
- from sklearn.model_selection import train_test_split
103
- from huggingface_hub import hf_hub_download
104
- import numpy as np
105
- import os, sys
106
-
107
- os.environ["RANK"] = "0"
108
- os.environ["WORLD_SIZE"] = "1"
109
- os.environ["MASTER_ADDR"] = "127.0.0.1"
110
- os.environ["MASTER_PORT"] = "29500"
111
-
112
- ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
113
- if ROOT_DIR not in sys.path:
114
- sys.path.insert(0, ROOT_DIR)
115
- from inference.predictor import LimiXPredictor
116
-
117
- X, y = load_breast_cancer(return_X_y=True)
118
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
119
-
120
- model_file = hf_hub_download(repo_id="stableai-org/LimiX-16M", filename="LimiX-16M.ckpt", local_dir="./cache")
121
-
122
- clf = LimiXPredictor(device='cuda', model_path=model_file, inference_config='config/cls_default_retrieval.json')
123
- prediction = clf.predict(X_train, y_train, X_test)
124
-
125
- print("roc_auc_score:", roc_auc_score(y_test, prediction[:, 1]))
126
- print("accuracy_score:", accuracy_score(y_test, np.argmax(prediction, axis=1)))
127
- ```
128
-
129
- 2. **Regression Task Example**
130
-
131
- ```python
132
- from functools import partial
133
-
134
- from sklearn.datasets import fetch_california_housing
135
- from sklearn.model_selection import train_test_split
136
- from sklearn.metrics import r2_score
137
- from huggingface_hub import hf_hub_download
138
- try:
139
- from sklearn.metrics import root_mean_squared_error as mean_squared_error
140
- except:
141
- from sklearn.metrics import mean_squared_error
142
- mean_squared_error = partial(mean_squared_error, squared=False)
143
- import os, sys
144
-
145
- os.environ["RANK"] = "0"
146
- os.environ["WORLD_SIZE"] = "1"
147
- os.environ["MASTER_ADDR"] = "127.0.0.1"
148
- os.environ["MASTER_PORT"] = "29500"
149
-
150
- ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
151
- if ROOT_DIR not in sys.path:
152
- sys.path.insert(0, ROOT_DIR)
153
- from inference.predictor import LimiXPredictor
154
-
155
- house_data = fetch_california_housing()
156
- X, y = house_data.data, house_data.target
157
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)
158
-
159
- y_mean = y_train.mean()
160
- y_std = y_train.std()
161
- y_train_normalized = (y_train - y_mean) / y_std
162
- y_test_normalized = (y_test - y_mean) / y_std
163
-
164
- model_path = hf_hub_download(repo_id="stableai-org/LimiX-16M", filename="LimiX-16M.ckpt", local_dir="./cache")
165
-
166
- model = LimiXPredictor(device='cuda', model_path=model_path, inference_config='config/reg_default_retrieval.json')
167
- y_pred = model.predict(X_train, y_train_normalized, X_test)
168
-
169
- # Compute RMSE and R²
170
- y_pred = y_pred.to('cpu').numpy()
171
- rmse = mean_squared_error(y_test_normalized, y_pred)
172
- r2 = r2_score(y_test_normalized, y_pred)
173
-
174
- print(f'RMSE: {rmse}')
175
- print(f'R2: {r2}')
176
- ```
177
-
178
- ## Ensemble Inference Based on Sample Retrieval
179
-
180
- For a detailed technical introduction to Ensemble Inference Based on Sample Retrieval, please refer to the [technical report](https://github.com/limix-ldm/LimiX/blob/main/LimiX_Technical_Report.pdf).
181
-
182
- Considering inference speed and memory requirements, ensemble inference based on sample retrieval currently only supports hardware with specifications higher than the NVIDIA RTX 4090 GPU.
183
-
184
- ### Classification Task
185
-
186
- ```plain text
187
- python inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data
188
  ```
189
 
190
- ### Regression Task
191
-
192
- ```plain text
193
- python inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data
194
- ```
195
 
196
- ### Customizing Data Preprocessing for Inference Tasks
197
 
198
- #### First, Generate the Inference Configuration File
199
 
200
- generate\_inference\_config()
201
-
202
- ### Classification Task
203
-
204
- #### Single GPU or CPU
205
-
206
- ```plain text
207
- python inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data
208
- ```
209
-
210
- #### Multi-GPU Distributed Inference
211
-
212
- ```plain text
213
- torchrun --nproc_per_node=8 inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data --inference_with_DDP
214
- ```
215
-
216
- ### Regression Task
217
-
218
- #### Single GPU or CPU
219
-
220
- ```plain text
221
- python inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data
222
- ```
223
-
224
- #### Multi-GPU Distributed Inference
225
-
226
- ```plain text
227
- torchrun --nproc_per_node=8 inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data --inference_with_DDP
228
- ```
229
-
230
- ### Retrieval Optimization Project
231
-
232
- This project implements an optimized retrieval system. To achieve the best performance, we utilize Optuna for hyperparameter tuning of retrieval parameters.
233
-
234
- #### Installation
235
-
236
- Ensure you have the required dependencies installed:
237
-
238
- ```plain text
239
- pip install optuna
240
- ```
241
-
242
- #### Usage
243
 
244
- For standard inference using pre-optimized parameters, refer to the code below:
245
 
246
- ```plain text
247
- searchInference = RetrievalSearchHyperparameters(
248
- dict(device_id=0,model_path=model_path), X_train, y_train, X_test, y_test,
249
- )
250
- config, result = searchInference.search(n_trials=10, metric="AUC",
251
- inference_config='config/cls_default_retrieval.json',task_type="cls")
252
  ```
253
 
254
- This will launch an Optuna study to find the best combination of retrieval parameters for your specific dataset and use case.
255
-
256
- ***
257
-
258
-
259
-
260
- # 6. Tool Invocation
261
-
262
- The LimiX model can integrate with various toolchains for extended functionality:
263
-
264
- * **Data Processing Tools**: Integrates with `pandas` and `scikit-learn` for data cleaning, feature engineering, and result evaluation (e.g., `r2_score`, `mean_squared_error`).
265
 
266
- * **Hyperparameter Optimization Tools**: Optimize retrieval parameters via the `hyperopt` library, example as follows:
267
-
268
- ```python
269
- # Hyperparameter search example (refer to inference_regression.py)
270
- from utils.inference_utils import sample_inferece_params
271
- hyperopt_config, base_config = sample_inferece_params(rng, 2, 4)
272
- model.set_inference_config(inference_config=hyperopt_config, **base_config)
273
- ```
274
-
275
- * **Distributed Inference**: Supports DDP (Distributed Data Parallel) mode for multi-GPU acceleration via `torch.distributed`.
276
-
277
- ***
278
-
279
-
280
-
281
- # 7. License
282
-
283
- 1. **Code License**: The repository code is licensed under the \[Apache-2.0 License]\(LICENSE.txt), allowing commercial use and secondary development with retention of the original copyright notice.
284
 
 
285
  2. **Model Weight License**: The use of LimiX model weights is subject to a separate Model License:
286
-
287
- * Fully open for academic research without authorization required.
288
-
289
- * Commercial use requires official authorization (refer to the license application process on the [StableAI official website](https://www.stable-ai.ai/)).
290
-
291
- ***
292
-
293
-
294
-
295
- # 8. Third-Party Notices
296
-
297
- This project uses the following third-party components, whose usage is governed by their respective licenses:
298
-
299
- * **PyTorch**: BSD-style license
300
-
301
- * **scikit-learn**: BSD license
302
-
303
- * **flash-attention**: MIT License
304
-
305
- * **Hugging Face Hub**: Apache-2.0 License
306
-
307
- * For the complete list of dependencies and license information, refer to `requirements.txt` and the official documentation of each component.
308
-
309
- ***
310
-
311
-
312
-
313
- # 9. Contact Us
314
-
315
- * **Official Documentation**: <https://www.limix.ai/doc/>
316
-
317
- * **GitHub Repository**: <https://github.com/limix-ldm/LimiX> (Submit issues for questions)
318
-
319
- * **Official Website**: <https://www.stable-ai.ai/> (For commercial cooperation and license inquiries)
320
-
321
- * **Technical Report**: [LimiX: Unleashing Structured-Data Modeling Capability for Generalist Intelligence](https://arxiv.org/abs/2509.03505)
322
-
323
- ***
 
1
+ ---
2
+ license: apache-2.0
3
+ pipeline_tag: other
4
+ tags:
5
+ - tabular
6
+ - foundation-model
7
+ ---
8
 
9
+ # LimiX-2M
10
 
11
+ LimiX-2M is a 2M-parameter tabular foundation model designed to mitigate low-rank collapse and attention bottlenecks in structured data. It was introduced in the paper [LimiX-2M: Mitigating Low-Rank Collapse and Attention Bottlenecks in Tabular Foundation Models](https://huggingface.co/papers/2606.04485).
12
 
13
+ - **GitHub Repository:** [https://github.com/limix-ldm-ai/LimiX](https://github.com/limix-ldm-ai/LimiX)
14
+ - **Project Page:** [https://www.limix.ai/](https://www.limix.ai/)
15
 
16
+ # 1. Model Introduction
17
 
18
+ **LimiX** is a new class of tabular AI model designed to overcome one of modern machine learning’s longest-standing bottlenecks: structured data. With only **2M parameters**, **LimiX-2M** sets a new state-of-the-art across classification, regression, and missing-value imputation, surpassing XGBoost, CatBoost, AutoGluon, and TabPFN. Its lightweight, training-free design makes advanced tabular modeling accessible on ordinary hardware while preserving full transparency and offline deployability.
19
 
20
  **Key Features**
21
 
22
+ - **Unified Tabular Reasoning:** End-to-end designed for multi-task tabular intelligence, enabling a single model to handle classification, regression, and imputation without additional tuning or task-specific fine-tuning.
23
+ - **Training-Free, Context-Driven Inference:** Operates directly through in-context learning: no training, no hyperparameters, no preprocessing pipelines.
24
+ - **Lightweight & Efficient Deployment:** A compact 2M-parameter architecture enables fast inference on standard CPUs and laptops.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
+ # 2. Model Usage
27
 
28
+ To use LimiX-2M, you need to clone the official repository and install the dependencies listed in the [Deployment](#4-deployment) section.
29
 
30
+ ### Classification Task Example
 
 
31
 
32
+ ```python
33
+ from sklearn.datasets import load_breast_cancer
34
+ from sklearn.metrics import accuracy_score, roc_auc_score
35
+ from sklearn.model_selection import train_test_split
36
+ from huggingface_hub import hf_hub_download
37
+ import numpy as np
38
+ import os, sys
39
 
40
+ # Setup environment for inference
41
+ os.environ["RANK"] = "0"
42
+ os.environ["WORLD_SIZE"] = "1"
43
+ os.environ["MASTER_ADDR"] = "127.0.0.1"
44
+ os.environ["MASTER_PORT"] = "29500"
 
 
 
45
 
46
+ # Assuming the LimiX repository is cloned and in the python path
47
+ # from inference.predictor import LimiXPredictor
48
 
49
+ X, y = load_breast_cancer(return_X_y=True)
50
+ X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
51
 
52
+ # Download model weights
53
+ model_file = hf_hub_download(repo_id="stableai-org/LimiX-2M", filename="LimiX-2M.ckpt", local_dir="./cache")
 
 
54
 
55
+ # Initialize predictor (Requires local inference code from GitHub)
56
+ # clf = LimiXPredictor(device='cuda', model_path=model_file, inference_config='config/cls_default_retrieval.json')
57
+ # prediction = clf.predict(X_train, y_train, X_test)
58
 
59
+ # print("roc_auc_score:", roc_auc_score(y_test, prediction[:, 1]))
60
+ # print("accuracy_score:", accuracy_score(y_test, np.argmax(prediction, axis=1)))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  ```
62
 
63
+ # 3. Model Architecture & Pretraining
 
 
 
 
64
 
65
+ LimiX adopts a 12-block transformer architecture with axis-wise attention to features and samples. LimiX-2M specifically utilizes the **RaBEL** framework, which expands each scalar into compact localized RBF features to improve conditioning and shallow-layer effective rank.
66
 
67
+ The model is pretrained through **Context-Conditional Masked Modeling (CCMM)**. By masking table cells and conditioning predictions on context rows, the model learns a wide range of conditional dependencies, allowing it to adapt to new datasets without task-specific training.
68
 
69
+ # 4. Deployment
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
+ For manual deployment, install the following dependencies:
72
 
73
+ ```bash
74
+ pip install python==3.12.7 torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1
75
+ pip install scikit-learn einops huggingface-hub matplotlib networkx numpy pandas scipy tqdm typing_extensions xgboost kditransform hyperopt
 
 
 
76
  ```
77
 
78
+ *Note: Flash Attention 2 is recommended for optimal performance.*
 
 
 
 
 
 
 
 
 
 
79
 
80
+ # 5. License
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
+ 1. **Code License**: The repository code is licensed under the [Apache-2.0 License](LICENSE.txt).
83
  2. **Model Weight License**: The use of LimiX model weights is subject to a separate Model License:
84
+ - Fully open for academic research.
85
+ - Commercial use requires official authorization from [StableAI](https://www.stable-ai.ai/).
86
+
87
+ # 6. Citation
88
+
89
+ If you use LimiX-2M in your research, please cite the following:
90
+
91
+ ```bibtex
92
+ @article{zhang2025limix,
93
+ title={Limix: Unleashing structured-data modeling capability for generalist intelligence},
94
+ author={Zhang, Xingxuan and Ren, Gang and Yu, Han and Yuan, Hao and Wang, Hui and Li, Jiansheng and Wu, Jiayun and Mo, Lang and Mao, Li and Hao, Mingchao and others},
95
+ journal={arXiv preprint arXiv:2509.03505},
96
+ year={2025}
97
+ }
98
+
99
+ @article{limix2m2026,
100
+ title={LimiX-2M: Mitigating Low-Rank Collapse and Attention Bottlenecks in Tabular Foundation Models},
101
+ author={Zhang, Xingxuan and others},
102
+ journal={arXiv preprint arXiv:2606.04485},
103
+ year={2026}
104
+ }
105
+ ```