Abstract
Modern neural networks predominantly utilize real-valued scalars for weights and activations. AlgebraNets challenge this convention by representing these components as elements of alternative associative algebras, such as quaternions or $2 \times 2$ matrices. This architectural shift significantly enhances parameter efficiency and compute density. Our evaluation across large-scale benchmarks—including ImageNet and WikiText-103—demonstrates that AlgebraNets can match or exceed state-of-the-art performance with a fraction of the parameters, positioning them as a viable and efficient alternative for large-scale deep learning.
Introduction
The "default" choice of real numbers ($\mathbb{R}$) in neural networks is largely a historical artifact of hardware optimization and simplicity. While complex-valued ($\mathbb{C}$) and quaternion-valued ($\mathbb{H}$) networks have been explored previously, their application has been mostly limited to small-scale datasets. AlgebraNets aim to bridge this gap by investigating whether alternative number representations can scale to massive, real-world tasks while offering superior trade-offs in parameter count, computational cost (FLOPs), and memory bandwidth.
The AlgebraNet Framework
The fundamental innovation of AlgebraNets is the replacement of atomic real-valued scalars with "tuples" that represent elements of a chosen algebra. For instance, in an $M_2(\mathbb{R})$ AlgebraNet, every weight and activation is a $2 \times 2$ matrix.
Multiplication and Compute Density
Standard multiplication is replaced by the specific multiplication rule of the chosen algebra. This structure inherently increases compute density—the ratio of arithmetic operations to memory loads. In a standard real-valued layer, loading two values (weight and activation) results in one multiplication (a 1:2 ratio). In contrast, a $2 \times 2$ matrix multiplication performs 8 operations for 8 values loaded (a 1:1 ratio). This efficiency is particularly beneficial for memory-bandwidth-limited scenarios like auto-regressive inference and sparse models.
Scaling and Implementation
Contrary to previous assumptions that complex algebras required specialized "whitening" procedures, we find that standard Batch Normalization and Glorot initialization are sufficient for scaling. This allows AlgebraNets to serve as a near drop-in replacement for standard layers in existing deep learning frameworks.
Experimental Evaluation
We evaluated AlgebraNets on several challenging benchmarks, focusing on the trade-offs between accuracy, parameters, and FLOPs.
ImageNet Classification
In ResNet-50 experiments, the $M_2(\mathbb{R})$ algebra emerged as a "sweet spot." As shown in the figures, it provides exceptional parameter efficiency, matching the baseline accuracy with significantly fewer parameters. Crucially, this efficiency does not come at the cost of increased computational complexity.
Language Modeling
The benefits extend to language modeling. On the Enwik8 task, an $M_2(\mathbb{R})$-Transformer-XL achieved 0.99 bits-per-character (BPC) with only 31.2 million parameters—a reduction of over $50\%$ compared to a 69.4 million parameter real-valued baseline. Similarly, on WikiText-103, a complex-valued ($\mathbb{C}$) GRU matched baseline performance while using $1.45\times$ fewer parameters.
Discussion and Future Work
The success of AlgebraNets likely stems from implicit regularization caused by structured weight reuse. While theoretical compute density is high, current software libraries are heavily optimized for real-valued operations; custom kernels will be necessary to fully realize speed gains on modern hardware. Future research will explore non-associative algebras and further optimize the final linear layers in large-vocabulary models.
Conclusion
AlgebraNets demonstrate that moving beyond real-valued scalars can yield significant gains in model efficiency without sacrificing performance. By providing a scalable framework for alternative algebras, this work opens new avenues for designing high-performance, parameter-efficient neural architectures.
Summary updated