cs.LGMar 17, 2026

Functorial Neural Architectures from Higher Inductive Types

Authors: Karen Sargsyan

Organizations: Institute of Chemistry, Academia Sinica, Taipei, Taiwan

Abstract

Neural networks often learn the parts of a task but fail on novel combinations of those parts. We argue that this failure is architectural: a decoder generalizes compositionally only when it respects the algebraic laws of the task, i.e. when it descends from freely generated sequences to the quotient determined by those laws. We make this principle constructive by compiling Higher Inductive Type (HIT) specifications into neural architectures. Basepoints, path constructors, and 2-cells are mapped to base constraints, generator networks, structural concatenation, and learned homotopies. The resulting transport decoders are strict monoidal functors by construction: decoding a concatenated word is concatenation of independently generated loop segments. In contrast, we prove that softmax self-attention cannot simultaneously satisfy strict monoidal composition and descent to any non-trivial compositional quotient. Experiments on the torus, wedge of circles, and Klein bottle validate the predicted hierarchy: functorial decoders outperform non-functorial alternatives by 22--10×10\times, and a learned 2-cell closes a 46%46\% error gap precisely on words exercising the Klein-bottle relation. These results suggest that compositional generalization should be enforced as functorial structure in the architecture, rather than learned from examples alone.

Figures & tables

Appendix figures & tables5 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. TPR-Attention for Combinatorial Generalization

    Aug 31, 2026Melisa Civelekoğlu, Isabeau Prémont-SchwarzAttention MechanismsCompositional Representation Learning

  2. Learning Sparse Compositional Functions with Norm-Constrained Neural Networks

    May 25, 2026Shuo Huang, Lorenzo Fiorito, Lorenzo Rosasco +1Neural Network GeneralizationHierarchical Representation Learning