An Algorithm for Computing with Brauer's Group Equivariant Neural Network Layers

Edward Pearce-CrumparXiv 2023 · DOI

Abstract

Equivariant Neural Networks (ENNs) are powerful tools for learning from data with inherent symmetries, but their implementation for groups like the orthogonal or symplectic groups has historically been computationally expensive. This paper introduces a novel algorithm that leverages category theory and diagrammatic algebra to decompose complex equivariant layers into efficient, structured operations. By factoring Brauer diagrams into planar components, the authors achieve a significant reduction in computational complexity, moving from exponential to polynomial scaling.

Introduction

Equivariant Neural Networks are designed to respect specific symmetries in data, such as rotations or reflections. While these networks are highly parameter-efficient and generalize well with limited data, they are notoriously difficult to implement efficiently for groups beyond simple permutations. Specifically, for groups like $O(n)$ or $Sp(n)$, the weight matrices are spanning sets indexed by complex combinatorial objects called set partition diagrams. Until now, the lack of a fast, scalable multiplication algorithm for these layers has limited their practical application in deep learning at scale. This paper addresses this gap by providing a unified framework for efficient computation across $O(n)$, $SO(n)$, and $Sp(n)$.

Methods: From Diagrams to Efficient Matrices

The core contribution of this work is the use of Category Theory—specifically monoidal categories and functors—to transform a difficult linear algebra problem into a manageable diagrammatic one.

Diagrammatic Proxy

Instead of directly manipulating massive, dense matrices, the algorithm operates on set partition diagrams, specifically Brauer diagrams. These diagrams serve as a blueprint for the underlying matrix structure, representing the symmetry-preserving linear maps.

Examples of Brauer diagrams (a, b, c) used as proxies for equivariant weight matrices in high-order tensor spaces.

The FACTOR Procedure and Planarity

The algorithm employs a FACTOR procedure to "unravel" a complex diagram into three distinct parts: a permutation of indices, a planar diagram (where no lines cross), and another permutation.

The key insight is that a planar diagram corresponds to a Kronecker product of very small, simple matrices. This decomposition is crucial because multiplying by a Kronecker product is significantly faster than multiplying by a full dense matrix. The process effectively factors a massive, dense equivariant operation into a sequence of sparse, structured operations.

Illustration of diagram composition and stacking, representing the factoring of complex operations into simpler, structured components.

The MATRIXMULT Algorithm

The resulting MATRIXMULT algorithm follows a three-step process:

  1. Permute: The input vector is permuted according to the first part of the factored diagram.
  2. Compute: Fast matrix multiplication is performed using the Kronecker product decomposition of the planar core.
  3. Permute: The resulting vector is permuted again to produce the final output.

Key Insights and Results

  • Planarity is Efficiency: In diagrammatic algebra, crossings represent complex interactions. Factoring diagrams into a planar core reveals that the underlying linear operation is a tensor product of simple operations like contractions or copies, which are computationally inexpensive.
  • Complexity Reduction: For $O(n)$ and $Sp(n)$, the algorithm reduces time complexity from a naive $O(n^{l+k})$ to $O(n^{k-1})$. In high-dimensional tensor spaces, this is the difference between an impossible calculation and one that fits on a modern GPU.
  • Parallelism: Because the algorithm relies on Kronecker products and independent permutations, it is naturally suited for parallel execution on hardware like GPUs or TPUs.

Conclusion and Future Work

This paper provides a significant algorithmic leap for Equivariant Neural Networks by moving from theoretical characterization to efficient implementation. While the asymptotic complexity is greatly improved, future work is needed to explore the constant factors involved in diagram manipulation and to provide empirical benchmarks against standard dense layers. The development of a concrete software library based on these constructions will be a vital next step for the broader deep learning community.

Summary updated

BibTeX
@misc{pearcecrump2023algorithm,
  author = {Edward Pearce-Crump},
  title = {{An Algorithm for Computing with Brauer's Group Equivariant Neural Network Layers}},
  year = {2023},
  eprint = {2304.14165},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.14165},
}
Figure