Compositional Generalization Certificates via the Van Kampen Theorem
Karen Sargsyan
Abstract
A neural network trained on the multiplication table of the quaternion group $Q_8$ can achieve perfect accuracy within each of two overlapping cyclic subgroups and predict every cross-region product wrong. In the quaternion example, exact local representations that agree on the shared subgroup but differ there from a fixed faithful target have matrix loss four in complex dimension two. We align local representations on their finite overlap by a chosen unitary basis change. The van Kampen universal property then extends the aligned pair uniquely to the amalgamated free product. This gluing is described by a homotopy pullback of representation groupoids. The resulting certificate bounds cross-region matrix error using local approximation errors, agreement with the target, overlap structure, and how faithfully the model composes its operators. For central cyclic overlap, we show the lower bound $2(d-r_{\max})$ under uniform sampling on complete overlap orbits, where $r_{\max}$ counts matching overlap eigenvalues. This provides a quantitative framework for assessing generalization to unseen compositions, showing what locally consistent operators guarantee and what additional conditions are needed for accurate prediction.
Successful Page Load