Papers
Topics
Authors
Recent
Search
2000 character limit reached

A homotopy-type-theoretic generalization of neurosymbolic inference

Published 16 Jun 2026 in cs.AI and cs.LO | (2606.17851v1)

Abstract: A wide range of neurosymbolic (NeSy) systems compute one functional: a belief-weighted sum of a logical quantity over a space of $ฯƒ$-structures, of which weighted model counting, fuzzy logic, and probabilistic logic are special cases. This account is built on sets, and a set deliberately forgets two things that are important for NeSy: when two $ฯƒ$-structures are the same up to a symmetry of the theory, and how many distinct proofs witness a query. Replacing the underlying sets by types, in the sense of homotopy type theory, preserves this information, and turns this functional into a belief-weighted homotopy cardinality, a notion of size that counts each object in inverse proportion to its symmetries. We develop the framework from scratch for NeSy systems, prove a conservativity theorem that recovers the classical functional when symmetries are trivial, and show that the symmetry our framework exposes is exactly the one behind reasoning shortcuts. The payoff is concrete: the shortcut-aware concept posterior that recent methods reach by ensembling or expressive density estimation is the only symmetry-invariant point of the confusion-set simplex, computable in closed form by averaging a single model over the symmetry group. On MNIST reasoning-shortcut benchmarks this single-model wrapper is better calibrated than a diversity-trained ensemble, while leaving label accuracy and identifiable concepts untouched. Code is freely available at https://github.com/bio-ontology-research-group/hott-nesy.

Summary

  • 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 ฯƒ\sigma-structuresโ€”is fundamentally set-theoretic and, by design, neglects symmetries among ฯƒ\sigma-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 ฯƒ\sigma-structures:

Fฮธ(ฯ†)=โˆซฮฉโ„“(ฯ†,ฯ‰)bฮธ(ฯ‰)โ€‰dm(ฯ‰)F_\theta(\varphi) = \int_{\Omega} \ell(\varphi, \omega) b_\theta(\omega) \, \mathrm{d}m(\omega)

Traditionally, ฮฉ\Omega is a set; thus, any structural symmetries or proof multiplicities are forgottenโ€”a process referred to as "decategorification." The proposed framework reconstructs ฮฉ\Omega as a type, encoding the automorphism group structure and the relationships (identifications) among ฯƒ\sigma-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)=1โˆฃGโˆฃโˆ‘gโˆˆGpฮธ(gโˆ’1โ€‰โฃโ‹…cโˆฃx)\bar{p}(c \mid x) = \frac{1}{\lvert G \rvert} \sum_{g \in G} p_\theta(g^{-1}\!\cdot c \mid 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 GG.

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. ฯƒ\sigma0), 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.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.