Topological Coherence: Rust implementation of toroidal constraints for coherent inference
Abstract
Update (2026-07-06): subsequent preregistered 5-seed replications also returned null for training-time toroidal regularization on held-out data (Qwen2.5-7B and Mistral-7B-Instruct-v0.3); "training-time/in-sample effects remain valid" refers to in-sample MC1 gains only. Correction (2026-07-05): The “Why Geometry Prevents Hallucination” framing is retracted — a controlled replication found the inference-time toroidal logit bias yields no statistically significant hallucination reduction (McNemar p=0.22); training-time/in-sample effects remain valid. Topological Constraints for Coherent Language Models: Why Geometry Prevents Hallucination We prove that hallucination in large language models is a geometry problem: unconstrained latent dynamics permit arbitrary drift through latent space. We establish a hierarchy of sufficient conditions for coherent inference: mHC (Birkhoff) ⊂ ERLHS (Hamiltonian) ⊂ Karmonic (Toroidal + Spectral) The Tonnetz torus provides a constructive topology with constant spectral gap λ₁ = Θ(1), enabling exponential suppression of incoherent modes. We prove DeepSeek's Manifold-Constrained Hyper-Connections (mHC) is a special case of ERLHS coherence preservation on the Birkhoff polytope. Experimental validation on Phi-2 (2.7B): toroidal attention achieves +19.5% relative improvement on TruthfulQA and best-in-class HaluEval (52.60%), while random sparse attention shows no benefit — confirming geometric structure, not sparsity, drives improvement. v3 additions: Graph Attention Networks comparison (Veličković et al., ICLR 2018), Volume-Spectral Duality theorem, zigzag persistence validation (Gardinazzi et al.), information-theoretic foundations (Zenil 2026), Hyperbolic LLMs comparison, Neural Latent Geometry Search framing (NeurIPS 2023). 15 references (up from 7). Paper: 21 pages, 15 citations Code: https://github.com/Paraxiom/topological-coherence Crate: https://crates.io/crates/topological-coherence Demo: https://huggingface.co/spaces/paraxiom-research/topological-coherence
Fields of Study & Subjects
Topological and Geometric Data Analysis
Advanced Graph Neural Networks
Functional Brain Connectivity Studies
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 5 July 2026
- Document type
- Preprint