Skip to content

mathai

Alternative mathematical foundations for machine intelligence: a research repository investigating whether fundamentally different mathematical structures can support learning, inference, generalisation and adaptation without relying on the conventional primitives of neural networks (neurons, weights, gradients, backpropagation, attention).

Five architectures are implemented, each with its own mathematical foundation that directly determines its computational behaviour:

Architecture Foundation What "learning" means
ODSI Cellular sheaves, sheaf cohomology Measure edge disagreement, remove selected edges, and report graph cohomology dimensions under stated assumptions
SBI Group actions, automorphisms, invariants Discover empirical permutation symmetries and canonicalise complete orbits when group enumeration fits configured limits
DBI Matroid rank, circuits, closure Per-class subspace closure; dependency-compressed regression
GCI Vanishing ideals and polynomial relations Estimate degree-bounded vanishing polynomials and recover an explicit law when identifiable; exact Gröbner computation is deferred
OLM Natural-number concept ranks Revise ranks and add concepts; finite update batches terminate, with no global convergence claim

None of the five uses gradient descent, backpropagation, or a differentiable computational graph as its core learning mechanism.

Historical reported results (10 repeats, paired splits, CPU)

Task Best architecture Result Honest note
Polynomial law recovery GCI RMSE 0.000 (exact) The relation is polynomial; GCI's niche
Linear recurrence recovery DBI RMSE 0.000 (exact) The relation is linear; matroid feature-basis finds it
Permutation-invariant threshold task SBI accuracy 0.984 in the historical processed report The label is a sum threshold and is invariant under the full symmetric group, not only C4
Digits (3-class subset) ODSI accuracy 1.000 Locality/sheaf propagation with data-adaptive bandwidth
XOR ODSI / OLM / SBI 1.000 / 1.000 / 0.995 GCI also 0.982 (XOR is a polynomial relation)

These figures are historical reported results, not independently validated estimates. The archived raw files are byte-identical and each contains 150 records; the processed report contains 500 rows, including 50 documented skips. Of 150 overlapping records, 27 accuracy values differ. The benchmark system now writes isolated runs; a later run does not resolve the discrepancy in the historical artifacts.

The historical processed report suggests that conventional baselines often match or exceed the structural architectures on standard tabular tasks. Because the historical artifacts disagree, that comparison needs a clean, independently checked comparison. A local December 2026 run produced 500 records: 380 completed, 30 failed and 90 were skipped. Some MLP baselines reached their iteration limit. These outputs have not been independently reconciled against the raw data. The research goal is not to establish general superiority, but to test whether different mathematical mechanisms can support useful learning under explicit assumptions.

Set up a virtual environment

Python 3.10 or later is required. From the repository root, create and activate an environment, then install the project with its development tools.

Git ignores virtual environments, caches and temporary run-write files. Experiment records remain visible to Git.

macOS and Linux:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Windows PowerShell:

py -3 -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Quick start

python -m mathai list-models
python -m mathai validate                 # smoke-test every architecture
python -m mathai evaluate --model odsi --dataset iris
python -m mathai benchmark --datasets xor,iris,group_invariant --repeats 10

Python API:

from mathai.architectures.gci import GCI, GCIConfig
from mathai.core.config import TaskType
from mathai.datasets import make_polynomial_law

X, y = make_polynomial_law(seed=0)
cfg = GCIConfig(task=TaskType.REGRESSION)
m = GCI(cfg).fit(X, y)
print(m.knowledge.law_poly)        # the recovered polynomial
m.save("checkpoints/gci.pkl")

Repository layout

mathai/
├── src/mathai/            core, 5 architectures, datasets, evaluation, statistics, CLI
├── tests/                 unit, mathematical property, statistical, integration, e2e
├── docs/                  getting started, API, benchmarking, limitations
├── experiments/           named experiment configs
├── configs/               dev / research / large profiles
├── scripts/               benchmark + statistics runners
├── results/               raw, processed, statistics, figures, reports
└── reproducibility/       environment + reproducibility notes

Status and limitations

  • All five architectures are implemented and covered by tests. Historical reports include synthetic mathematical-law tasks and four small real-world datasets, but comparative measurements are not independently validated.
  • One full-MNIST ODSI run and a Naive Bayes baseline completed; neither has been independently reproduced. Because of compute requirements, large-dataset subsamples were tested on an external Linux machine; see the large-dataset results. Full CIFAR-10, Covertype and HIGGS experiments are not documented here, and the ordinary benchmark does not load these datasets.
  • The benchmark skips GCI when d > 8 and DBI when d > 25. GCI does not compute Gröbner bases from approximate generators. DBI circuits are skipped above 60 points per class; fundamental circuits require exact rank calculations.
  • DBI now computes exact rank on the represented floating-point values. Its fitting step uses pivoted QR to prefer stable exact bases and rejects a selected basis that is numerically rank-deficient at rank_tol. Pivoting does not prove that no stable alternative exists. The full suite passed 249 tests on macOS with Python 3.15.2 after this change; exact arithmetic may be much slower than the previous numerical rank.
  • Local macOS smoke tests and test suites also passed with Python 3.10.22 and 3.11.18. The Python 3.10 run emitted GCI numerical runtime warnings; their cause has not been established. These runs do not establish that the Ubuntu GitHub Actions jobs pass.
  • Formal verification (Lean/Coq) of the mathematical theorems is not performed; property tests are empirical.

Full MNIST experiment

The separate Docker workflow uses OpenML mnist_784 version 1 and the first 60,000 rows for training, with the remaining 10,000 for testing. It uses all 784 raw pixel features and one model per run. It requires a populated scikit-learn OpenML cache; containers have no network access. Build and run from the repository root:

docker build -f Dockerfile.mnist -t mathai-mnist:local .
python scripts/run_mnist_docker.py --model odsi --data-home "$HOME/Downloads/mathai-datasets/sklearn"

Each container has a 4 GiB memory limit with no swap and a 30-minute timeout. The worker checks cgroup v2 limits before loading data and fails if it cannot verify them. Docker Desktop's VM and other host processes use additional memory. Docker must be running, and its VM must have sufficient resources. The run writes run.json, a container log when available, and a worker record when produced under a new results/runs/mnist-* directory. Check the status: a timeout, failure, or skip is not a prediction result.

The runner records GCI and DBI as skipped under the existing feature guards. SBI's candidate-permutation search and OLM's full-test concept scan are also skipped under this compute budget. An explicit --attempt-guarded option attempts a guarded model without changing its features or the container limits. It can exhaust the container's memory or reach the timeout. A progress record is saved before training when data loading succeeds. ODSI may also time out or run out of memory. --model naive_bayes runs a conventional baseline separately.

Model Status Test accuracy Run record
ODSI completed 97.05% ODSI
Naive Bayes completed 55.58% baseline
SBI failed: container out of memory — SBI
DBI timed out after 30 minutes — DBI
GCI failed: container out of memory — GCI
OLM interrupted; no predictions — OLM

These are single runs on the same split, not independent replications or a statistical comparison. SBI, DBI, GCI and OLM were attempted with the guard override after initially being skipped; none produced predictions. The stopped OLM run is recorded as failed with a null error because of a runner reporting bug, now fixed; the worker snapshot remains incomplete. The dataset and architecture source fingerprints match across these runs; the override changed the worker source. A dataset fingerprint does not establish source authenticity. Dependencies are not locked, and rebuilding the image may select different versions.

External MNIST subsample

An external Linux experiment used 12,000 training and 3,000 test examples per run. The table gives mean test accuracy across three completed records per model from the MNIST and Covertype run. SBI was skipped in all three records.

Model Mean test accuracy
ODSI 94.92%
OLM 95.26%
DBI 66.31%
GCI (8 PCA components) 64.84%
Naive Bayes 56.56%
SBI skipped

These runs used a different split and code version from the full-MNIST experiment. The Linux runner is archived, but the architecture implementation used by the runs is maintained outside this repository. The results cannot be reproduced from this checkout. See the large-dataset results for the records, figure and limits on statistical interpretation.

Licence

Apache License 2.0. Copyright 2026 Rohan R. See LICENSE and NOTICE. Every original file carries SPDX metadata; REUSE.toml covers binary artefacts that cannot carry inline headers.

Author

Rohan R (2026). Repository namespace: rotsl/mathai.