- The paper introduces a homotopy-type-theoretic framework that replaces set-based inference with a symmetry-aware, proof-relevant type-based approach.
- The paper leverages homotopy cardinality to compute symmetry-invariant measures, achieving superior calibration on benchmarks like MNIST reasoning-shortcut tests.
- The paper's closed-form, parameter-free method unifies traditional algebraic model counting and lifted probabilistic inference, mitigating reasoning shortcuts in NeSy systems.
Homotopy-Type-Theoretic Generalization of Neurosymbolic Inference
Introduction and Motivation
This work introduces a homotopy type theory (HoTT) based refinement of neurosymbolic (NeSy) inference, providing a systematic generalization of widely used NeSy systems such as weighted model counting (WMC), probabilistic logic, and fuzzy logic. The standard NeSy functionalโaggregation of neural belief weights over admissible ฯ-structuresโis fundamentally set-theoretic and, by design, neglects symmetries among ฯ-structures and the multiplicity of independent proofs, both of which are crucial for relational and structured modalities in NeSy.
By replacing sets with types in the sense of HoTT, the inference process not only preserves these symmetries and proof identities but also exposes structural sources of reasoning shortcuts. This generalization leads to substantial computational and representational advances, particularly in the characterization and mitigation of reasoning shortcuts in NeSy models.
Homotopy-Type-Theoretic Lift of NeSy Inference
The classical NeSy inference functional computes a belief-weighted sum (or integral) over logical values assigned to ฯ-structures:
Fฮธโ(ฯ)=โซฮฉโโ(ฯ,ฯ)bฮธโ(ฯ)dm(ฯ)
Traditionally, ฮฉ is a set; thus, any structural symmetries or proof multiplicities are forgottenโa process referred to as "decategorification." The proposed framework reconstructs ฮฉ as a type, encoding the automorphism group structure and the relationships (identifications) among ฯ-structures.
The primary technical innovation is the belief-weighted homotopy cardinality, which replaces naive counting with a symmetry-aware measure, weighting each element by the inverse of its stabilizer size. This homotopy lift maintains a direct path to the classical functional under trivial symmetry or idempotent semirings, as shown by the conservativity theorem proved and mechanized in Lean.
Beyond set-level aggregation, the framework parameterizes both a symmetry quotient (e.g., acting by subgroups of the automorphism group) and a truncation level reflecting the type-theoretic complexity of proofs (propositions, sets, groupoids). The cardinality of the dependent sum over structureโwitness pairs internalizes proof provenance and symmetry simultaneously.
Reasoning Shortcuts and Symmetry-Invariant Inference
A central, operational implication is the identification of reasoning shortcuts with orbits under the output-preserving group action of the logical theory's symmetries. The confusion sets previously described in NeSy literature correspond precisely to group orbits in the HoTT framework.
The shortcut-aware concept posterior, previously attainable only via regularization, ensembling (e.g., BEARS [marconato2024bears]), or expressive density estimation [vankrieken2025nesydm], is characterized as the unique symmetry-invariant point in the confusion set simplex. This symmetry-enforced uniform distribution arises naturally and can be computed in closed form via closed-form orbit averaging:
pหโ(cโฃx)=โฃGโฃ1โgโGโโpฮธโ(gโ1โ
cโฃx)
This construction ensures that (i) label accuracy is preserved, (ii) the invariant posterior is uniformly distributed over each confusion set, and (iii) the computational cost is limited to a forward pass and a sum over the group G.
Numerical Experiments
On MNIST reasoning-shortcut benchmarks, the orbit-averaged single-model wrapper achieves calibration of the concept posterior on confusable (unidentifiable) concepts, outperforming or matching BEARS ensembles in calibration error (conf-ECE $0.01$ vs. ฯ0), without degrading label accuracy or identifiability for non-confusable concepts. The approach is parameter-free, closed-form, and obviates the need for ensembles or additional supervision. In XOR-parity settings, the model avoids systemic biases in parity assignment, in contrast with both base and naively ensembled models.
Theoretical Impact and Relation to Prior Work
Type-theoretic generalization offers several theoretical advantages:
- Proof Relevance: The dependent sum construction supports proof provenance, enabling nuanced reading between mere satisfaction, counting derivations, and identifying symmetric derivations in a uniform axis determined by truncation level.
- Representation Invariance: By leveraging the univalence axiom, the semantics of inference are invariant under isomorphic representations of logical knowledge, a property not available in traditional set-based foundations without explicit isomorphism management.
- Generative Compositionality: For exchangeable models, the belief-weighted homotopy cardinality recovers the exponential generating function, in precise agreement with combinatorial species theory and supporting correct compositional semantics across relational structures.
The framework systematically situates traditional algebraic model counting [kimmig2017algebraic], lifted probabilistic inference [vandenbroeck2011lifted], and contemporary treatments of reasoning shortcuts [marconato2023notall, vankrieken2025rsindependence] as special cases or decategorified instances.
Open Problems and Future Directions
Despite the formal advances, a canonical extension of homotopy cardinality to continuous domains compatible with real-cohesive HoTT remains unresolved. The development of synthetic measures over continuous types would bridge the gap between symbolic and subsymbolic NeSy modalities in a symmetry-conscious way, providing further theoretical cohesion and potentially novel inference mechanisms in relational and probabilistic AI.
Conclusion
This work demonstrates that recasting NeSy inference in the language of HoTT yields a symmetry-aware, proof-relevant, and representation-invariant functional that strictly generalizes the classical set-based framework, with concrete algorithmic and statistical benefits in mitigating reasoning shortcuts. Symmetry-aware inference arises naturally as the only invariant point in the confusion set, offering new closed-form and efficient alternatives to current ensemble-based shortcut-awareness protocols. The integration of homotopy types sets a rigorous foundation for future NeSy systems with rich symmetry and proof structure, and the continuous generalization remains a central avenue for further research.