A ground-up computational substrate for machine reasoning. It replaces the neuron, the vector space, and backpropagation with three new primitives — and grounds its mathematics in algebraic topology and the notebooks of Ramanujan.
For a decade we taught machines that meaning is a coordinate. Transformers perfected the geometry of averages — and called interpolation understanding.
There is a cost we rarely name. When two facts contradict, softmax averages them away — it cannot hold "A is true" and "A is false" at once, even when both are true in different contexts. When a goal changes, attention re-weights edges but never changes which relationships exist. And every token, surprising or mundane, pays the same quadratic price. The model cannot be surprised. It can only be weighted. TORIS begins from a different axiom — and follows the mathematics all the way down.
Every axis of the architecture is re-derived from first principles. This is the line, drawn plainly.
Each old pillar of deep learning is swapped for a structure that carries meaning about the connection itself — not just a scalar.
A typed, directional, surprise-bearing transformation between concepts. A connection now knows what kind of relationship it is — causal, contradictory, analogous — not merely how strong.
A context-adaptive typed hypergraph. Concepts have no coordinates; they hold roles that shift with the goal. The field physically rewires as you reason.
Local anomaly propagation. Confirmed predictions are suppressed at the source and cost nothing. Only what you did not expect flows forward.
No cosine. No dot product. TORIS measures how the shape of knowledge changed, decomposed into three parts.
A relator only propagates its surprise when ε > θ. Confirmed predictions are silenced — the formal core of selective computation.
Not a forward pass over frozen weights. A cycle that predicts, is surprised, and physically reorganizes the graph — then warps it again toward the goal.
The Goal Manifold recomputes salience for every relator. Edges below threshold are removed from the active topology; relevant ones amplify. Two goals yield two structurally different fields — not two attention masks.
Incoming structure meets the warped prediction. The topological surprise ΔS is computed per relator.
Confirmed predictions are suppressed and consume zero compute. Only surprising relators propagate forward.
Fast plasticity edits the topology in place: new relators are instantiated where surprise revealed a gap; perfect predictors fade into background.
When relators contradict, they enter the Contradiction Log. A productive contradiction — where the tension itself is the answer — is never collapsed. Impossible under softmax.
The depth-d surprise of a field is a coefficient of its generating function \(Z_F(\kappa)\) — the same object form as the partition generating function \( \prod_n 1/(1-x^n) \). That single identification imports four of Ramanujan's results, each one buying a concrete computational power.
Ramanujan's three exact congruences — holding for all m — become structural zeros in relational surprise. At these depths, computation provably does nothing, so TORIS does nothing.
Ramanujan's constant \( e^{\pi\sqrt{163}} \) is almost an integer because 163 is a Heegner number. TORIS borrows the idea: a field whose partition function is nearly an integer sits at a critical configuration — maximum modular coherence, where all four results converge fastest.
Layers 7 and 9 extend this further — an analytic surprise functional with a running coupling (asymptotic freedom for surprise), and an exact Rademacher series that computes surprise to arbitrary precision with certified error bounds. The mathematics is not decoration. It is the engine.
Not GLUE. Not MMLU. TORIS is evaluated on five behaviors that are impossible for attention-based models — and demonstrated end to end.
Smoke enables evacuation — it triggers the alarm and signals danger. And smoke negates evacuation — dense smoke blocks the exit corridor. Both are true. The tension is the knowledge.
A transformer softmaxes this into one muddy probability and loses the structure of why. TORIS logs the ENABLES ⊗ NEGATES pair as a productive contradiction — both relators stay live.
When the goal warps the field — "is the corridor passable?" — the relevant side amplifies while the other is held in reserve, not deleted. The same machinery serves legal reasoning, medical differentials, and contradictory scientific evidence.
Built on networkx · numpy · scipy. Clone it and watch all five criteria pass in under two seconds.
# clone, install, and run the full demonstration git clone https://github.com/infinitule/TORIS.git cd TORIS python -m venv .venv && source .venv/bin/activate pip install -e ".[dev]" pytest tests/ # 231 tests python experiments/exp_toris_full_demo.py # all 5 criteria, end to end
from toris.primitives.relator import Relator from toris.primitives.relation_types import RelationType as T from toris.field.relational_field import RelationalField from toris.goal.manifold import GoalManifold, Goal from toris.reasoning.inference import InferenceLoop field = RelationalField() # smoke ENABLES evacuation … and also NEGATES it — a real contradiction field.add_relator(Relator(T.ENABLES, smoke, evac, sigma=0.7, kappa=0.6)) field.add_relator(Relator(T.NEGATES, smoke, evac, sigma=0.4, kappa=0.3)) manifold = GoalManifold(primary=Goal(description='ensure_safety')) loop = InferenceLoop(field, manifold) rec = loop.step([...]) print(rec.delta_s, len(manifold.contradiction_log)) # the tension survives → 1