cs.LGMar 15, 2026

Ternary Gamma Semirings: From Neural Implementation to Categorical Foundations

Authors: Ruoqi Sun

Organizations: Intelligent Game and Decision Lab(IGDL), No.1 Xianghongqi Road, Haidian District, Beijing, 100091,China.

Abstract

This paper establishes a theoretical framework connecting neural network learning with abstract algebraic structures. We first present a minimal counterexample demonstrating that standard neural networks completely fail on compositional generalization tasks (0% accuracy). By introducing a logical constraint -- the Ternary Gamma Semiring -- the same architecture learns a perfectly structured feature space, achieving 100% accuracy on novel combinations. We prove that this learned feature space constitutes a finite commutative ternary ΓΓ-semiring, whose ternary operation implements the majority vote rule. Comparing with the recently established classification of Gokavarapu et al., we show that this structure corresponds precisely to the Boolean-type ternary ΓΓ-semiring with ∣T∣=4|T|=4, ∣Γ∣=1|Γ|=1}, which is unique up to isomorphism in their enumeration. Our findings reveal three profound conclusions: (i) the success of neural networks can be understood as an approximation of mathematically ``natural'' structures; (ii) learned representations generalize because they internalize algebraic axioms (symmetry, idempotence, majority property); (iii) logical constraints guide networks to converge to these canonical forms. This work provides a rigorous mathematical framework for understanding neural network generalization and inaugurates the new interdisciplinary direction of Computational ΓΓ-Algebra.

Figures & tables

Explore similar work

CardsList
  1. Grokking Finite-Dimensional Algebra

    Feb 23, 2026Pascal Jr Tikeng Notsawo, Guillaume Dumas, Guillaume RabusseauGrokkingNeural Network Generalization

  2. Algebraic Representability as the Limiting Regime of Grokking: An Exactly Solvable Model with Holomorphic Activations

    Jul 15, 2026Chon-Fai Kam, Xavier Cadet, Miloud Bessafi +1Feedforward Neural NetworksNeural Network Expressivity