ToricGT: A Five-Paper Program for Algebraic, Geometric, and Graph-Structured Reasoning Agents
The short answer is: use mathematics as train-time scaffolding, not as decoration.
ToricGT uses toric geometry, combinatorial commutative algebra, filtered topology, sheaves, vector bundles, representation-theoretic certificates, graph-structured retrieval, and oracle trajectory labels as finite, auditable training signals. The deployed model keeps only the components that improve held-out bits-per-byte, reasoning accuracy, retrieval quality, controllability, or artifact efficiency.
The five papers in the current program are:
- ToricGT with Toric BGG Supervision
- ToricGT II: Dynamical, Ergodic, and Derived Persistence Geometry
- ToricGT III: Sheafified MCP Memory, Graph-Structured Vector Retrieval, and Long-Context Tropical Ring Attention
- ToricGT IV: Oracle Trajectory Classifiers
- Toric Algebraic Training Objectives for ToricGT
Together they propose a stack for training reasoning agents whose intermediate computations are graph-structured, algebraically audited, retrieval-aware, behavior-classified, and compression-gated.
The governing metric: bits-per-byte
The program is built around a strict compression rule. For a held-out byte string (x), define
An auxiliary certificate, retrieval index, trajectory classifier, quantizer, adapter, or cache is useful only if it improves this metric on the relevant held-out stream, or improves a predeclared reasoning/control metric without worsening it.
This is important because mathematical structure can easily become expensive ornamentation. ToricGT instead treats mathematics as an engineering resource with a price:
Only positive-utility structure should survive deployment.
Paper I: ToricGT as graph-token reasoning with finite certificates
The first paper introduces the base model. A structured problem is converted into a typed attributed graph. Nodes and edges become tokens. A graph-token transformer processes the resulting token table while preserving graph relabeling symmetry.
A ToricGT model has the form
where (T) is a graph tokenizer, (\Phi_\ell) are equivariant transformer blocks, and (D) is a decoder for node, edge, graph, trajectory, or language outputs.
The core additions are optional algebraic modules:
- tropical attention, which implements max-plus or min-plus dynamic-programming primitives;
- toric chart probes, which expose active affine candidates, normal-fan cells, one-dimensional cones, margins, and bend diagnostics;
- finite BGG/Koszul/Tate/Euler-Koszul certificates, which supervise hidden trajectories through exact chain-complex constraints;
- GraphCG concept axes, which make behavior and reasoning coordinates inspectable;
- GFlowNet graph-of-thought search, which samples diverse reasoning completions;
- trajectory memory, which retrieves previous reasoning patterns by algebraic and topological signatures.
The central shift is that the model is not trained only to output an answer. It is also trained to produce hidden moves that behave like structured finite objects. For example, a certificate can require an approximate differential (\widehat\partial) to satisfy
That loss asks the hidden reasoning trajectory to respect the most basic law of a chain complex: boundary after boundary is zero.
Paper II: reasoning trajectories as dynamical persistence objects
The second paper asks what happens when reasoning is iterative. A single reasoning step is modeled as a standardized packet containing token embeddings, graph state, verifier fields, retrieved evidence, behavior coordinates, and certificate summaries. From each packet we build a filtration
of simplicial complexes. These complexes produce persistence modules, Betti summaries, sheaf data, vector-bundle features, differential-form features, and derived-object residuals.
The model update becomes a learned graph-to-graph map
Repeated reasoning is therefore a dynamical system:
This lets us define losses and metrics such as barcode stability, recurrence time, entropy rate, mixing/decorrelation, Lyapunov-style stability, sheaf-gluing consistency, derived mapping-cone error, and toric chamber occupancy.
The pragmatic motivation is simple. A good model should not thrash through hidden states. It should move through reasoning space in a stable, evidence-sensitive, compressive way. Persistence and ergodic summaries give us finite measurements of that behavior.
Paper III: MCPs, markdown memory, knowledge graphs, and long context
The third paper moves the ToricGT object outside the model. Real agents interact with model context protocols, markdown-style memory, tool traces, retrieved documents, and knowledge graphs. ToricGT III models this substrate as a typed graph database.
A memory graph can contain nodes for:
- messages and reasoning blocks;
- markdown sections;
- tool calls and tool outputs;
- prompts and resources;
- knowledge-graph entities and relations;
- citations and provenance;
- permissions and safety metadata;
- embeddings and quantized codes;
- certificate summaries and verifier states.
Edges encode containment, reference, temporal order, authorization, semantic similarity, contradiction, and support.
The database stores graph-structured vectors. A node vector might be
where (e_v) is a dense embedding, (c_v) is a quantized toric code, (p_v) is provenance, (q_v) is a certificate summary, and (s_v) is a sheaf-like local section descriptor.
For efficiency, the system trains a retrieval projection
so approximate nearest-neighbor search runs in a smaller projected space. Retrieval then expands through graph adjacency and reranks candidates by provenance, sheaf-gluing consistency, persistence compatibility, and verifier relevance.
The long-context extension treats the full context window as a finite canvas of length (L_C\le 10^7), potentially 1--10M tokens. The agent progressively fills this canvas with reasoning blocks, retrieved memory, MCP observations, knowledge-graph neighborhoods, verifier traces, and answer drafts. Tropical ring attention gives a streaming max-plus semantics for active evidence and provenance over the window.
The guiding rule remains marginal utility: a retrieved block should enter context only when its expected contribution exceeds its token and artifact cost.
Paper IV: oracle trajectory classifiers
The fourth paper introduces an oracle layer. The oracle reads partial or complete reasoning trajectories and classifies them by properties such as:
- accuracy;
- evidence grounding;
- verifier agreement;
- compliance and refusal appropriateness;
- safety;
- tone corridor;
- personality profile;
- verbosity;
- proof rigor;
- uncertainty calibration;
- retrieval hygiene;
- memory hygiene;
- MCP/tool discipline;
- graph-of-thought compositionality;
- efficiency.
The oracle can be a small classifier head, a frozen-backbone probe, a low-rank adapter stack, or a full transformer over trajectory packets. Its labels are not treated as independent binary tags. They live in a structured property space: a poset, a compatibility complex, and a toric property fan.
This matters because behavior properties interact. High confidence is compatible with strong evidence and verifier agreement. It is not compatible with weak provenance unless the model explicitly signals uncertainty. A refusal may be appropriate in one chamber of the behavior fan and inappropriate in another.
The oracle can improve training through:
- supervised loss weighting;
- rejection sampling;
- preference optimization;
- reward shaping;
- retrieval filtering;
- memory pruning;
- test-time trajectory steering.
A simple oracle-assisted objective is
The goal is not to make the model sound nicer in a superficial way. The goal is to classify and shape reasoning trajectories so that they are more accurate, grounded, efficient, controllable, and appropriate to the task.
Paper V: toric algebra as an objective library
The fifth paper returns to the algebraic core. It reviews Part II, “Toric Algebra,” of Miller--Sturmfels and translates its objects into neural training infrastructure.
The main dictionary is:
| Toric algebra | Neural training interpretation |
|---|---|
| affine semigroup | quantized dictionary of reasoning increments |
| semigroup ring | algebra of composable trajectory features |
| lattice ideal | binomial constraints among equivalent reasoning paths |
| Hilbert basis | minimal reusable reasoning dictionary |
| initial ideal | degeneration and curriculum target |
| multigrading | separation of task, evidence, proof, memory, and style degrees |
| K-polynomial | compact support/cancellation summary |
| Betti numbers | syzygy profile of proof obligations |
| Scarf or hull resolution | finite certificate complex |
| toric quotient | symmetry reduction and invariant coding |
| Ehrhart/Brion methods | sparse counting and vertex-decomposed retrieval |
| local cohomology | coverage diagnostic for missing reasoning regions |
A typical binomial consistency loss comes from a lattice relation (u-v\in L):
If two different reasoning paths represent the same algebraic move, their learned log-coordinates should agree. This is a direct way to penalize path-dependent hallucination in structured reasoning.
Why toric geometry?
Toric geometry is useful here because it converts geometry into combinatorics. Cones, one-dimensional cones, affine semigroups, normal fans, polytopes, Cox coordinates, sheaves, and divisors all have finite descriptions. Neural networks, especially ReLU and tropical submodules, already create piecewise-linear regions. Toric language gives a disciplined way to audit those regions.
For a tropical probe
the active candidates define a face of a lifted Newton polytope. The hidden space is partitioned into normal-fan cells. Margins to cell walls become stability metrics. Bends across walls become diagnostics of decision changes. This turns hidden max-plus computation into something inspectable.
How this becomes an implementation
A practical implementation can be staged.
Stage 1: baseline graph-token training. Train the graph-token transformer on supervised graph, language, or reasoning tasks. Confirm equivariance and score-before-update validation.
Stage 2: tropical and toric probes. Add low-rank probes for active candidates, normal-fan cells, one-dimensional cones, margins, moment summaries, and bend diagnostics. Run them audit-only before turning them into losses.
Stage 3: finite algebraic certificates. Attach small Koszul, BGG, Euler-Koszul, lattice-ideal, or Scarf-resolution certificates to examples. Use sparse losses and exact finite-field audits.
Stage 4: persistence dynamics. Build filtered simplicial complexes over reasoning windows. Penalize unstable barcodes, broken chain maps, and unexplained changes in homology.
Stage 5: memory and retrieval. Convert MCP traces, markdown memory, and knowledge graphs into graph-structured vectors. Train a projected retrieval head, then rerank by adjacency, provenance, and certificate compatibility.
Stage 6: oracle trajectory classification. Train an oracle head or oracle transformer on trajectory properties. Use it for reward shaping, filtering, preference optimization, and behavior control.
Stage 7: compression-gated export. Quantize, ablate, and export only what improves held-out bits-per-byte or predeclared reasoning/control metrics.
What should be measured?
The program needs ordinary and structural metrics:
- held-out bits-per-byte;
- answer accuracy;
- verifier agreement;
- proof validity;
- retrieval precision and recall;
- evidence grounding;
- context-token utility;
- artifact byte cost;
- tool-call correctness;
- memory hygiene;
- tone and personality-corridor stability;
- refusal appropriateness;
- barcode stability;
- chain-map residual;
- sheaf-gluing defect;
- toric chamber margin;
- binomial relation residual;
- Betti-profile prediction error;
- oracle calibration error.
A structural metric is not enough by itself. It matters only if it predicts or improves task quality, compression, controllability, or safety.
The research bet
The ToricGT bet is not that algebraic geometry is magic. It is that reasoning agents benefit from finite, reusable, auditable structures. Toric and commutative-algebraic methods are attractive because they provide exactly such structures: semigroups, ideals, complexes, modules, fans, filtrations, and quotients.
The program can be summarized as:
Each arrow adds structure, but each structure must pay rent through held-out bits-per-byte, reasoning quality, retrieval utility, or behavior control.
That is the full ToricGT program: use beautiful mathematics secondarily, but useful mathematics first.