Taming Binarized Neural Networks and Mixed-Integer Programs

Johannes Aspman, Georgios Korpas, Jakub Marecek

Abstract

Binarized Neural Networks (BNNs) offer significant advantages in computational efficiency and interpretability but are notoriously difficult to train due to their non-differentiable discrete activations. This paper establishes a rigorous mathematical bridge between Deep Learning and Mixed-Integer Programming (MIP). By reformulating BNN training through the lens of subadditive duality and proving that the resulting dual functions are "tame" (definable in o-minimal structures), the authors enable the use of mathematically sound implicit differentiation. This framework allows BNNs to be trained with a consistent chain rule for the first time, moving beyond the heuristic limitations of the Straight-Through Estimator (STE).

Introduction: The Gradient Vacuum in BNNs

In standard deep learning, weights and activations are continuous, allowing optimization via gradient descent. Binarized Neural Networks (BNNs), however, utilize binary activations (0 or 1). While this makes them exceptionally fast on specialized hardware and allows them to be interpreted as sets of logical rules, it creates a "gradient vacuum": the derivative of the activation function is zero almost everywhere and undefined at the step.

Architecture of a Binarized Neural Network (BNN) with discrete activations.

To circumvent this, practitioners typically use the Straight-Through Estimator (STE), which approximates the gradient during the backward pass. However, STE is mathematically inconsistent—the gradient used for updates does not correspond to the function used in the forward pass. This inconsistency often leads to poor convergence and unreliable model explanations. This research seeks a mathematically rigorous way to perform backpropagation that is consistent with the BNN's discrete structure.

Methodology: Bridging MIP and Tame Topology

The authors' approach integrates concepts from Mixed-Integer Programming (MIP) and Tame Topology to create a differentiable framework for discrete models.

1. MIP Reformulation

The first step involves representing the BNN as a Mixed-Integer Linear Program (MILP). This maps the neural network's architecture into a well-studied optimization framework.

2. Subadditive Duality

While convex optimization relies on Lagrangian duality, discrete problems like MIPs require a more robust framework. The authors utilize subadditive duality, where the "dual" is a function rather than a single scalar value. This function captures the sensitivity of the MIP's optimal value to changes in its constraints.

3. Tame Geometry and o-minimal Structures

The core theoretical contribution is proving that for "nice" MIPs (those with compact feasible sets and finite non-differentiable points), the subadditive dual is tame. In this context, "tame" means the function is definable in an o-minimal structure, ensuring it behaves predictably without infinite oscillations.

4. Conservative Fields

Because the dual is tame and locally Lipschitz, it can be analyzed using conservative fields. This generalized derivative framework provides a valid chain rule, making the discrete optimization process compatible with standard automatic differentiation tools like PyTorch or TensorFlow.

Key Theoretical Results

The paper's primary contribution is Theorem 4, which proves that for a class of "nice" conic MIPs, there exists an equivalent reformulation that is definable in an o-minimal structure. This is directly applied to BNNs in Corollary 1, confirming that they allow for implicit differentiation and a valid chain rule.

These results imply that the weight updates in the backward pass finally correspond to actual subgradients of the forward paths, solving the fundamental flaw of the Straight-Through Estimator.

Approximation Strategy

Constructing exact subadditive duals is computationally expensive. To make the framework practical, the authors demonstrate that the complex dual can be approximated by piecewise-linear functions.

Piecewise-linear approximation of the subadditive dual function.

As shown in Figure 4, the approximation $\tilde{f}(b)$ can track the behavior of the true value function $f(b)$. By increasing the number of segments in this approximation, researchers can achieve a high-precision training signal that is fully compatible with existing deep learning software.

Conclusion and Future Directions

This work "tames" the chaotic landscape of discrete AI, providing a path toward gradient-based training of symbolic structures like optimal decision trees and causal graphs. However, challenges remain regarding computational complexity and scalability. Constructing these duals for ResNet-scale architectures will require highly optimized algorithms. Future research will likely focus on finding the optimal balance between approximation precision and training performance for large-scale applications.

Summary updated

BibTeX
@inproceedings{aspman2024taming,
  author = {Johannes Aspman and Georgios Korpas and Jakub Marecek},
  title = {{Taming Binarized Neural Networks and Mixed-Integer Programs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i10.28968},
}
Figure