Weaves, Wires, and Morphisms: Formalizing and Implementing the Algebra of Deep Learning

📅 2026-04-08
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the absence of a unified formal mathematical framework for describing deep learning models, which hinders precise characterization of nonlinear broadcasting and component composition. To bridge this gap, the paper proposes a novel modeling framework grounded in category theory, introducing the first categorical formulation of axis-stride semantics and array broadcasting. This approach enables algebraic and formal representation of model architectures, supporting graph transformation, compilation, and visualization. The framework is implemented in both Python (pyncd) and TypeScript (tsncd), demonstrating consistent and practical applicability across platforms, including PyTorch compilation and Diagram-based rendering.
📝 Abstract
Despite deep learning models running well-defined mathematical functions, we lack a formal mathematical framework for describing model architectures. Ad-hoc notation, diagrams, and pseudocode poorly handle nonlinear broadcasting and the relationship between individual components and composed models. This paper introduces a categorical framework for deep learning models that formalizes broadcasting through the novel axis-stride and array-broadcasted categories. This allows the mathematical function underlying architectures to be precisely expressed and manipulated in a compositional manner. These mathematical definitions are translated into human manageable diagrams and machine manageable data structures. We provide a mirrored implementation in Python (pyncd) and TypeScript (tsncd) to show the universal aspect of our framework, along with features including algebraic construction, graph conversion, PyTorch compilation and diagram rendering. This lays the foundation for a systematic, formal approach to deep learning model design and analysis.
Problem

Research questions and friction points this paper is trying to address.

deep learning
formal framework
model architecture
broadcasting
category theory
Innovation

Methods, ideas, or system contributions that make the work stand out.

categorical framework
axis-stride
array-broadcasted
compositional modeling
formal semantics
🔎 Similar Papers
No similar papers found.
V
Vincent Abbott
Laboratory for Information and Decision Systems, Massachusetts Institute of Technology
Gioele Zardini
Gioele Zardini
Rudge (1948) and Nancy Allen Assistant Professor at MIT
Robotic NetworksCo-DesignMulti-Agent AutonomyCompositionalityITS