Axiom (base)
Causal discovery for tabular data. In one forward pass over a whole table (rows x
variables), Axiom labels every pair of variables causes (a -> b), caused_by (b -> a),
undirected (linked, direction not identifiable), confounded (no edge, hidden common
cause) or none, with probabilities, and assembles the result into an acyclic graph.
Missing values and rows from known experiments are supported.
Treat the graph as hypotheses to check against domain knowledge: uncertain pairs are candidates for experiments; confident ones can feed causal effect identification and estimation.
11.9M parameters, fp32 safetensors (48 MB). Project page: maxpagels.com/axiom.
Recommended use (ballpark)
| recommendation | |
|---|---|
| rows | 256 or more works best; usable from ~100; below that, results get unreliable. Over 2048 rows, discover averages 8 random 2048-row subsets (raise n_subsets to use more of a big table). |
| variables | trained on 2-50. On simulated data it held up to 100 with no loss in accuracy; beyond 50 on real data is untested. Memory grows quickly with the variable count (~1 GB on CPU at 100, ~3 GB at 200). |
| interventions | if any rows come from experiments, label all of them: unlabeled experimental rows act like hidden causes and can produce wrong or reversed edges. |
| output | treat edges and especially directions as ranked hypotheses to check, not a verdict (see Limitations). |
Usage
pip install "git+https://huggingface.co/maxpagels/axiom-base"
Upgrading from an earlier version: add -U (pip install -U "git+https://huggingface.co/maxpagels/axiom-base").
From 0.3.0 on, the package loads the weights released with it, so code and weights always match.
Before 0.3.0 the weights always came from main: a 0.2.0 install loads the current weights
without an error but gives wrong results. Upgrade, or pin it to its own release (see Versions).
from axiom import Axiom
model = Axiom.from_pretrained("maxpagels/axiom-base")
g = model.discover(df) # pandas DataFrame or (n, d) array; NaN = missing
print(g) # the relations found, strongest first
# rows from known experiments: one entry per row (None = observational),
# or an (n, d) bool mask
targets = [None, "PKC", ["PKA", "PIP3"], None, ...] # column(s) each row's experiment targeted
g = model.discover(df, interventions=targets)
discover standardizes each column as in training (do not pass raw model inputs
yourself unless you use axiom.preprocess). Tables with more than 2048 rows are split into
random 2048-row subsets whose predictions are averaged.
Reading the result
For every pair of variables a and b, Axiom gives a Relation(a, b, kind, p, probs):
kind: Axiom's conclusion about how a and b are causally linked, one of the five below.p: the model's probability for that kind.probs: the probabilities of all five kinds (they sum to 1);kindis the decision,probsthe evidence behind it.
| kind | meaning | example |
|---|---|---|
causes |
a directly causes b (a -> b) | smoking -> tar in lungs |
caused_by |
b directly causes a (b -> a) | the same pair, read from the other side |
undirected |
a and b are directly linked, but the data cannot tell which way | linear-Gaussian data, where both directions fit equally well |
confounded |
no direct link, but an unmeasured variable causes both | ice cream sales and drownings (hidden cause: hot weather) |
none |
no direct link |
A kind is always read from the first variable: g.relation("PKA", "PKC").kind == "causes" and
g.relation("PKC", "PKA").kind == "caused_by" describe the same edge.
Only direct links count. In a -> b -> c, the pair a, c is none, even though a affects c,
because that effect passes through b. Drop b from the table and a -> c becomes a direct
link: what counts as direct depends on which variables you include.
g.relations # [Relation(a, b, kind, p, probs), ...]: the relations found,
# strongest first; directed ones read cause first
g.edges # [(cause, effect, p), ...]: directed edges only
[r for r in g.relations if r.kind == "confounded"] # one kind only: here, the pairs
# likely to share a hidden cause
g.relation("PKA", "PKC") # any one pair, also "none" ones: Relation(a='PKA', b='PKC',
# kind='causes', p=0.85, probs={'none': 0.0, 'causes': 0.85, ...})
g.to_frame() # the relations found as a pandas DataFrame: a, b, kind, p, p_<kind>...
g.to_frame(all_pairs=True) # every pair, plus `top`, the most probable kind
A pair only gets a kind other than none if its probability clears thresh (default 0.5;
lower it with e.g. model.discover(df, thresh=0.3)). The raw probabilities and 0/1
matrices behind all this are on g too; see help(g).
Versions
Each release is a tagged commit in this repo; main is the latest. To use a specific one,
install its code and load its weights by tag:
pip install "git+https://huggingface.co/maxpagels/axiom-base@v1.0.0"
model = Axiom.from_pretrained("maxpagels/axiom-base") # this package's release: v1.0.0
model = Axiom.from_pretrained("maxpagels/axiom-base", revision="v0.2.0") # weights of another release
- v1.0.0: a new physical SCM family in the training prior (equation-shaped mechanisms on natural scales, exact relations, many-input nodes, discrete variables inside the system); trained on 2-50 variables (was 2-25); same architecture as 0.3.x.
- v0.3.1: weights load strictly: code and weights that do not match raise an error instead of silently dropping weights; same weights as 0.3.0.
- v0.3.0: classical pair statistics (correlations, partial correlations, pairwise direction cues) as model input; per-row condition ids (
discover(conditions=...)); trained on 2-25 variables with a more realistic prior (experiment mixtures, skewed noise, feedback loops, measurement artefacts); weights pinned to the package version. - v0.2.0: the release of October 2026.
Benchmarks: CausalArena
Unverified. Axiom's numbers below were not produced or checked by the CausalArena maintainers: Axiom has been submitted to CausalArena but not yet reviewed, and is not on its leaderboard. They come from running the benchmark's public release with this repo's evaluation code, scored with the leaderboard's metrics as far as they are published (the SHD rule is not; this code counts a reversed edge once, which fits the leaderboard's own numbers).
CausalArena tests causal discovery on three families of simulated SCMs (synthetic, semantic and formula-grounded), each observation-only and with interventions. Axiom v1.0.0 as released, default settings, on all 6000 tables of the public release (600 released SCMs x 5 replicates x 2 regimes, 1000 rows each; with interventions, Axiom gets the released intervention mask). Axiom is trained on 2-50 variables; the synthetic graphs with 100 variables are run the same way.
Overall, against the leaderboard's public board (the same 600 released SCMs; retrieved 2026-11-18).
| method | family | slices | F1 | SHD | SID | nSHD | precision | recall | AUROC | AP |
|---|---|---|---|---|---|---|---|---|---|---|
| Axiom (unverified) | Pretrained | 6 | 0.624 | 34.6 | β | 0.040 | 0.815 | 0.517 | 0.901 | 0.685 |
| FoundCause | Pretrained | 3 | 0.592 | 47.8 | 224.3 | 0.055 | 0.617 | 0.595 | 0.890 | 0.631 |
| GIES | Graphical search | 6 | 0.502 | 67.4 | 343.0 | 0.070 | 0.475 | 0.550 | β | β |
| TabCausal | Pretrained | 6 | 0.476 | 53.5 | 280.4 | 0.061 | 0.560 | 0.434 | 0.808 | 0.480 |
| CDFM | Pretrained | 3 | 0.422 | 77.1 | 290.1 | 0.086 | 0.400 | 0.483 | 0.826 | 0.419 |
| SDCD | Continuous optimization | 6 | 0.345 | 85.7 | 364.0 | 0.102 | 0.299 | 0.432 | β | β |
| CDIS | Graphical search | 6 | 0.326 | 71.8 | 359.6 | 0.065 | 0.452 | 0.268 | β | β |
| AVICI | Pretrained | 6 | 0.323 | 58.0 | 292.6 | 0.064 | 0.560 | 0.244 | 0.750 | 0.357 |
| SEA | Pretrained | 3 | 0.323 | 65.2 | 304.3 | 0.081 | 0.407 | 0.295 | 0.791 | 0.328 |
| CauScale | Pretrained | 6 | 0.320 | 66.0 | 297.1 | 0.092 | 0.365 | 0.320 | 0.762 | 0.312 |
| IGSP | Graphical search | 6 | 0.320 | 75.6 | 363.1 | 0.081 | 0.340 | 0.318 | β | β |
| Arrow | Pretrained | 3 | 0.303 | 60.4 | 306.5 | 0.069 | 0.432 | 0.246 | 0.725 | 0.296 |
| PC | Graphical search | 3 | 0.276 | 61.3 | 417.5 | 0.066 | 0.347 | 0.237 | β | β |
| NOTEARS-MLP | Continuous optimization | 3 | 0.254 | 66.3 | 370.3 | 0.081 | 0.293 | 0.234 | 0.702 | 0.206 |
| RandomRegress | Control | 3 | 0.246 | 138.0 | 465.5 | 0.159 | 0.200 | 0.367 | 0.534 | 0.132 |
| DAS | Functional assumptions | 3 | 0.237 | 90.2 | 362.3 | 0.109 | 0.219 | 0.271 | β | β |
| NOTEARS | Continuous optimization | 3 | 0.222 | 59.9 | 320.2 | 0.069 | 0.390 | 0.163 | 0.560 | 0.185 |
| DAGMA | Continuous optimization | 3 | 0.217 | 63.9 | 345.6 | 0.075 | 0.304 | 0.178 | β | β |
| LiNGAM | Functional assumptions | 3 | 0.215 | 62.1 | 309.0 | 0.070 | 0.424 | 0.155 | β | β |
Axiom per slice:
| slice | F1 | SHD | SID | nSHD | precision | recall | AUROC | AP |
|---|---|---|---|---|---|---|---|---|
| Synthetic, observation-only | 0.677 | 58.6 | β | 0.031 | 0.862 | 0.570 | 0.914 | 0.739 |
| Synthetic, with interventions | 0.675 | 59.0 | β | 0.032 | 0.854 | 0.572 | 0.910 | 0.732 |
| Semantic, observation-only | 0.654 | 22.0 | β | 0.044 | 0.857 | 0.535 | 0.916 | 0.732 |
| Semantic, with interventions | 0.667 | 21.6 | β | 0.043 | 0.864 | 0.550 | 0.920 | 0.740 |
| Formula, observation-only | 0.519 | 23.8 | β | 0.047 | 0.715 | 0.420 | 0.872 | 0.574 |
| Formula, with interventions | 0.553 | 22.8 | β | 0.045 | 0.737 | 0.457 | 0.876 | 0.597 |
CausalArena is by Li, Liu, Wang and Ye (arXiv:2609.11897); the benchmark data and the other methods' numbers above are theirs, under CC BY 4.0. Please cite it when using these results:
@article{li2026causalarena,
title={CausalArena: Benchmarking Causal Discovery in the Foundation Model Era},
author={Li, Zi-Rong and Liu, Si-Yang and Wang, Tian-Zuo and Ye, Han-Jia},
journal={arXiv preprint arXiv:2609.11897},
year={2026},
url={https://arxiv.org/abs/2609.11897}
}
- Downloads last month
- 441