Instructions to use mbarbosa1/zeno-divergent-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mbarbosa1/zeno-divergent-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="mbarbosa1/zeno-divergent-v1")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mbarbosa1/zeno-divergent-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
TL;DR
Forecasting models fail quietly. They keep returning confident numbers long after the world they were fitted to has moved on.
Zeno Divergent watches a stream of public observations and predicts the moment your expectation of that stream is about to break β a regime change, a cadence shift, a jump into a magnitude band the reference never expected.
- It outputs calibrated probabilities, not anomaly scores.
- It says "I don't know" out loud (explicit abstention gate) instead of guessing.
- It is tiny (~31k params, CPU, milliseconds) and sits next to your existing model.
- It is trained and evaluated on real public data, against rule baselines, with bootstrap confidence intervals.
pip install zeno-divergent
from transformers import AutoModel
import zeno_divergent # registers the architecture
model = AutoModel.from_pretrained("mbarbosa1/zeno-divergent-v1")
rows = model.score_events(observations, entity_id="grid_34.5_-118.5")
rows[-1].surprise_index # 0..1 ranking of "expectation is breaking here"
rows[-1].probabilities # calibrated probability per declared target
rows[-1].abstained # True -> no call, not "all clear"
Why this matters
Every deployed forecaster carries an invisible assumption: tomorrow looks enough like the data I was fitted on. When that assumption dies, the model does not raise its hand. Accuracy degrades, uncertainty stays flat, and the failure is only discovered downstream.
The usual answers are partial:
| Approach | What it tells you | What it misses |
|---|---|---|
Predictive uncertainty (Ο, ensembles) |
how noisy this prediction is | stays low right up to a regime break |
| Drift / OOD detectors | the inputs moved | fires on harmless movement, silent on harmful stable-looking shifts |
| Change-point detection | something changed already | it is a post-mortem, not a lead time |
| Zeno Divergent | the probability that an observable departure happens in the next window, calibrated, with an option to abstain | it is not a hazard forecast β see limits |
The falsifiable claim this model exists to test:
A learned representation of model-relative surprise contains information about future regime change and model failure that is not captured by predictive uncertainty or rule baselines alone.
The evaluation harness is built to reject that claim: every target is scored
against a phase-0 rule baseline with entity-level bootstrap CIs, and a promotion
gate refuses to move main unless the corpus is real and the lifts hold.
How it works
observations βββΆ schema contract βββΆ past-only features βββΆ shared encoder
β
βΌ
surprise state z^S
β
ββββββββββββββββββββββββββββββββββββββΌββββββββββββββββ
βΌ βΌ βΌ
calibrated p_k(t+Ξ) uncertainty Ο_k abstain gate
- Declare a schema. Categories, numeric channels, targets and a horizon. The schema is a contract, not a guess β it is hashed into the config.
- Build past-only features. Row
iis a function of observations0..iand nothing after it. Leakage is re-derived from the raw stream, not asserted. - Encode the surprise state
z^S. A 32-dimensional representation of how expectation is failing, shared across all heads. - Predict observable departures. One head per target: category-regime transitions, cadence shifts, magnitude-regime shifts, compound transitions.
- Calibrate, then gate. Probabilities are fitted on a held-out validation
split; low-evidence rows are marked
abstainedrather than scored.
What comes back
| Field | How to read it |
|---|---|
probabilities |
calibrated probability of each observable transition inside the horizon |
uncertainty |
heteroscedastic spread β large means poorly determined, not safe |
abstained |
admission control. "Not enough evidence", never "nothing to see" |
surprise_index |
max over targets β a ranking, not a probability of harm |
latent |
z^S itself, for probing and transfer studies (include_latent=True) |
Quick start
pip install zeno-divergent
from transformers import AutoModel
import zeno_divergent # registers config/model/pipeline with the Auto classes
model = AutoModel.from_pretrained("mbarbosa1/zeno-divergent-v1") # trust_remote_code=False
observations = [
{"timestamp": 1717171717.0,
"category": "light_shallow",
"values": {"magnitude": 3.2, "depth_km": 8.1}},
# ... chronological, one dict per observation
]
for row in model.score_events(observations, entity_id="region-A"):
if row.abstained:
continue
print(row.timestamp, round(row.surprise_index, 3), row.probabilities)
Categories and channels must match the schema published in config.json.
No trust_remote_code, no GPU, no network calls at inference time.
Architecture
| architecture | ZenoSurpriseModel β shared MLP encoder β z^S β per-target calibrated heads |
| parameters | ~30,859 (72 features β 128 hidden β 32 latent β 5 heads + log-variance + gate) |
| precision | float32, safetensors |
| domain | seismic (schema hash 8753db3bb6f6) |
| runtime | CPU, sub-millisecond per row |
Why is this smaller than v0.2.3?
It is a different model, not a shrunken one. v0.2.x was a multi-reference
encoder over a synthetic ten-mechanism generator with a wide simulated input
contract. v0.3 replaces that with a domain-neutral schema contract: the
input is a declared public observation stream, features are derived past-only
from that schema, and capacity is set by what the real corpus supports without
overfitting. Nothing was pruned or quantised. The larger synthetic model stays
frozen and loadable at revision v0.2.3.
Training data
Real public data β USGS FDSN event web service (public, credential-free).
| events | 47107 |
| entities | 224 |
| window | 2023-01-01 β 2025-07-01 |
| threshold | minimum magnitude 2.5 |
| splits | chronological, with a horizon buffer between splits |
No personal data, no identity, no intent, no ownership fields β the input contract rejects them.
Results (held-out test split)
| target | prevalence | AUROC (95% CI) | ECE | paired lift vs phase-0 rules |
|---|---|---|---|---|
event_regime_transition |
0.095 | 0.833 [0.784, 0.878] | 0.010 | 0.202 (significant) |
cadence_shift |
0.504 | 0.651 [0.629, 0.674] | 0.033 | 0.180 (significant) |
magnitude_regime_shift |
0.000 | 0.500 [0.500, 0.500] | 0.000 | -0.034 (not significant) |
significant_event_ahead |
0.407 | 0.917 [0.887, 0.940] | 0.052 | 0.563 (significant) |
compound_seismic_stress |
β | β | β | not evaluable (insufficient_available_rows) |
Abstention. Coverage 0.687; selective accuracy 0.859 vs base 0.763 (gain 0.095) β i.e. the rows the model chooses to answer are the rows it is right about.
Promotion gate: promoted. The full run report ships as
report.json, digests in SHA256SUMS. If those digests do not match your
rebuild, you are not looking at the same artifact.
Intended use
In scope
- Research on model-validity forecasting and surprise representations
- Advisory decision support with a named human owner
- Prioritising which observation to collect next
- Benchmarking change-point and surprise detectors against a locked protocol
- Reproducing β or falsifying β the claim above on your own corpus
Out of scope
- Automated or safety-critical actuation
- Reading the output as the probability of a physical event (it predicts model failure, not hazard)
- A single cross-domain risk number
- Scoring people. Entities are models, sensors, regions, instruments, processes β never individuals.
Limits
- Trained on one real public corpus (
seismic). Transfer to other domains is unverified and needs a schema of its own. - Probabilities are calibrated on the validation split; recalibrate before using them as decision thresholds in a new deployment.
- Abstention must be surfaced next to the score. Hiding it turns "not observed" into "not at risk" β that is a misuse.
- The model predicts observable transitions in a public descriptive stream. It makes no claim about identity, intent, ownership or causation.
Revisions
| revision | contents |
|---|---|
main / v0.3.1 |
v0.3.0 real-corpus checkpoint, transformers-native (this) |
v0.3.0 |
same weights, research release layout (checkpoint.pt + report) |
v0.2.3 |
frozen v0.2 prototype, remote-code loader, synthetic corpus |
v0.3.0-rc1 |
synthetic-validated architecture candidate |
Revisions are immutable: nothing published is ever overwritten in place.
Citation
@software{zeno_divergent_0_3_1,
title = {Zeno Divergent: learned model-relative surprise},
author = {Barbosa, M.},
year = {2026},
url = {https://huggingface.co/mbarbosa1/zeno-divergent-v1},
version = {v0.3.1}
}
zenodivergent.dev β live workspace, interactive benchmarks, full documentation.
- Downloads last month
- 156