Abstract
Training neural networks with discrete weights is a notoriously difficult NP-complete problem. This paper introduces an efficient version of the Max-Sum (MS) algorithm that scales at $O(N \log N)$ per update, matching the speed of Belief Propagation while proving more robust at breaking symmetries in complex, multi-layer architectures.
I. Introduction
Modern deep learning predominantly relies on continuous weights and gradient-based optimization. However, discrete neural networks—where weights are restricted to values such as $\{-1, 0, 1\}$—offer significant advantages for hardware efficiency and biological plausibility. Despite these benefits, training discrete networks is NP-complete. The discrete weight space prevents the use of gradients, turning learning into a combinatorial optimization task often plagued by numerous local minima. Standard local search methods usually get trapped in a "riddled" energy landscape, and while algorithms like Belief Propagation (BP) have been used, they often struggle with the inherent symmetries of fully-connected networks.
II. The Network Model
We consider networks with discrete synaptic weights. In these models, the problem of learning is equivalent to finding a configuration of weights that satisfies a set of constraints or minimizes an energy function. Because the weight space is discrete, the landscape is non-convex and full of local minima. Message-passing algorithms provide a framework to navigate this space by passing probabilistic "messages" between nodes. The underlying message-passing framework relies on the computation of cavity fields, which are derived exactly in the MS limit.
III. The Max-Sum Algorithm
We propose a variant of the Max-Sum (MS) algorithm, which is essentially the zero-temperature limit of Belief Propagation. To make this work for neural networks, we introduce several key innovations:
A. Max Convolution
Normally, updating a node in this framework would require $O(N^2)$ operations. However, we exploit the convexity properties of the problem. By treating the messages as concave piecewise-linear functions, we use a sorting-based approach to reduce the complexity to $O(N \log N)$ for bounded integer weights. This allows the algorithm to scale to large systems while computing convolutions exactly, unlike BP which often relies on Gaussian approximations.
B. The Binary Case and Symmetry Breaking
For binary synapses ($W \in \{-1, 1\}$), we add a time-dependent reinforcement term—a form of "soft decimation"—that gradually pushes the synapses toward definite discrete values. Crucially, we introduce small, random external fields (noise) to break the permutation symmetry in multi-layer "committee machines," where hidden units are identical. This noise helps the algorithm "choose" a direction, preventing the paralysis that often affects other message-passing solvers.
IV. Numerical Results
The study focuses on synthetic benchmarks commonly used in statistical mechanics:
- Random Classification (Storage): We find weights that correctly map $M$ random input vectors to random binary outputs. For binary synapses, the algorithm reaches a storage capacity of $\alpha \approx 0.75$ (where $\alpha = M/N$), close to the theoretical limit of $0.83$.
- Generalization (Teacher-Student): A "teacher" network generates labels for random inputs, and a "student" network learns the underlying rule. The MS algorithm successfully identifies the teacher's weights, showing a sharp transition in performance as more data is provided.
- Multi-layer Architectures: The algorithm successfully trained a committee machine with $K=3$ hidden units and $N=1001$ inputs, demonstrating greater discriminatory power than a single-layer network of the same size.
V. Conclusions
The Max-Sum algorithm provides a robust and efficient $O(N \log N)$ approach for training discrete neural networks. While each update is fast, the total number of iterations required to reach a solution scales polynomially with $N$, making it slightly slower than reinforced BP in some cases. However, its ability to handle multi-layer symmetries makes it a powerful tool for complex architectures. Future work will address how this algorithm handles structured, highly correlated data found in real-world tasks.
Summary updated