Khaos Tabular Anomaly Scoring
A transformer over the columns of a row, trained by predicting hidden cells across 28 tables. A row's anomaly score is how badly the hidden cells are predicted; it works zero-shot on tables the model never saw.
tab_anomaly_scoring v1, from Khaos (a local-first library of pre-trained models for domain-specific tasks). This is the first release of the artifact.
Model
- Architecture: TabularAnomalyTransformer: one token per column (value embedding plus random column slot), 4 transformer layers (dim 64, 4 heads), per-cell reconstruction
- Parameters: 818,561
- Format: ONNX (
model.onnx) plus PyTorch weights (model.pt) andmanifest.json - Training data: fletxcher/khaos-tab_anomaly_scoring
Results
Measured on the held-out test split of the training dataset.
| Metric | Value |
|---|---|
| test_mean_auroc | 0.8107 |
| baseline_isolation_forest_mean_auroc | 0.8354 |
| datasets_won_against_isolation_forest | 1 |
| n_test_datasets | 9 |
Row-level AUROC on held-out datasets
Khaos is applied zero-shot (never trained on these tables, labels never used). Isolation Forest is fit on each table itself.
| Dataset | Khaos AUROC | Isolation Forest AUROC |
|---|---|---|
| 23_mammography | 0.840 | 0.888 |
| 26_optdigits | 0.631 | 0.740 |
| 28_pendigits | 0.936 | 0.956 |
| 29_Pima | 0.653 | 0.671 |
| 32_shuttle | 0.991 | 0.997 |
| 38_thyroid | 0.982 | 0.974 |
| 47_yeast | 0.386 | 0.396 |
| 4_breastw | 0.981 | 0.988 |
| 6_cardio | 0.897 | 0.909 |
Training
{
"epochs": 60,
"batch": 256,
"lr": 0.001,
"architecture": "TabularAnomalyTransformer"
}
Best epoch 5, trained in 4.2 minutes on a single consumer GPU (RTX 3050 8 GB).
Intended use
Scoring rows of numeric tables for unusual combinations of values. Scale columns with robust_scale, hide 25% of cells, run 24 passes with different masks and average the error on hidden cells.
Limitations
- Numeric columns only, up to 64 columns.
- Zero-shot scores are competitive on some tables and weaker than a model fit to the table itself on others (see the per-dataset table).
- Anomaly definitions differ per dataset; the score measures unusualness, not importance.
Usage
pip install khaos
khaos serve ./tab_anomaly_scoring
License
This model was trained on data with research-only, share-alike or mixed terms (see the training dataset card for each source). Treat it as research use and check the upstream data licenses before any commercial use.