Axiom Discovery
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: liminalplanes.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/liminalplanes/axiom-discovery"
Upgrading from an earlier version: add -U (pip install -U "git+https://huggingface.co/liminalplanes/axiom-discovery").
Up to 1.0.0 the package was called axiom-causal: uninstall it first (pip uninstall axiom-causal),
or both stay installed and share the axiom folder, so removing either later breaks the other.
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("liminalplanes/axiom-discovery")
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; each subset's predictions are kept
too (see Stability across subsets).
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
Pairs are decoded in two steps, both against thresh (default 0.5; lower it with e.g.
model.discover(df, thresh=0.3)). First, is there an edge? A pair is linked if
P(causes) + P(caused_by) + P(undirected) clears thresh, else confounded if P(confounded)
does, else none. Then, which way? A linked pair gets a direction if that direction holds
more than thresh of the linked probability and keeps the graph acyclic; otherwise it is
undirected. So a pair that is clearly linked but split between directions is undirected,
and its p (P(undirected) alone) can be well below 0.5. The raw probabilities and 0/1
matrices behind all this are on g too; see help(g).
Stability across subsets
discover keeps each row subset's probabilities, so one call shows how much the result
depends on which rows the model saw. A table of 2048 rows or fewer is used whole, as a single
subset; pass a smaller n_rows to split it anyway.
g = model.discover(df, n_rows=1024, n_subsets=12) # 12 random 1024-row subsets
g.subsets() # 12 graphs, one per subset, read like g itself
g.stability() # (d, d): share of subsets that give each pair the same kind as g
g.to_frame() # now with a `stability` column
g.subset_probs # (12, d, d, 5): each subset's probabilities; g.probs is their mean
A relation with high p but low stability rests on a few subsets: treat it as less
certain than p alone suggests.
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/liminalplanes/axiom-discovery@v1.2.0"
model = Axiom.from_pretrained("liminalplanes/axiom-discovery") # this package's release: v1.2.0
model = Axiom.from_pretrained("liminalplanes/axiom-discovery", revision="v0.2.0") # weights of another release
- v1.2.0: graphs are decoded in two steps, matching the model's own heads: a pair is linked if P(causes) + P(caused_by) + P(undirected) clears
thresh, and then directed only if one direction holds more thanthreshof that, elseundirected; a pair clearly linked but split between directions is nowundirected(wasnone), and an edge that would close a cycle staysundirected(was dropped). At the defaultthresh(0.5), every relation 1.1.0 found is unchanged; same weights as 1.0.0. - v1.1.0: the package is now
axiom-discovery(wasaxiom-causal) and the repomaxpagels/axiom-discovery(wasmaxpagels/axiom-base);discoverkeeps each row subset's probabilities (g.subset_probs,g.subsets(),g.stability(), astabilitycolumn into_frame);decode_graphalso returns the confounded pairs (three values, was two); same weights as 1.0.0. - 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
Axiom is ranked first of 19 methods on the CausalArena leaderboard, overall and on each of its four benchmarks (synthetic, semantic, formula-grounded and real data).
The leaderboard's entry is Axiom v1.0.0; this release, v1.2.0, has not been benchmarked there itself (see Versions for what changed since).
CausalArena tests causal
discovery on 1,200 simulated SCMs in three families (synthetic, semantic and
formula-grounded; 600 public, 600 held out), each observation-only and with interventions,
plus 13 real datasets. Elo comes from pairwise comparisons of observation-only F1 and SHD,
with the three simulated families weighted equally and RandomRegress fixed at 1,000; F1 and
SHD are means over the 6 family x regime slices a method supports (slices), so methods
with fewer slices are not directly comparable on them.
The top 5, from the leaderboard (all 1,200 SCMs; retrieved 2026-11-28). The leaderboard refits Elo as methods are added, so see it for current numbers, the public and held-out splits, and more metrics.
| method | Elo | Synthetic Elo | Semantic Elo | Formula Elo | Real Elo | F1 | SHD | slices |
|---|---|---|---|---|---|---|---|---|
| Axiom | 1921 | 2043 | 2073 | 1844 | 1288 | 0.626 | 34.2 | 6/6 |
| FoundCause | 1700 | 1769 | 1867 | 1631 | 1065 | 0.593 | 47.0 | 3/6 |
| TabCausal | 1573 | 1659 | 1525 | 1633 | 1209 | 0.490 | 47.4 | 6/6 |
| GIES | 1484 | 1399 | 1637 | 1535 | 1079 | 0.511 | 65.9 | 6/6 |
| CDIS | 1389 | 1323 | 1532 | 1400 | 1089 | 0.339 | 68.1 | 6/6 |
CausalArena is by Li, Liu, Wang and Ye (arXiv:2609.11897); the benchmark and the 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
- 618