On the Hardness of Training Deep Neural Networks Discretely

Ilan Doron-Arad · DOI

Abstract

Training neural networks with discrete parameters (D-NNT) is a critical task for deploying models on resource-constrained hardware via quantization. However, the theoretical complexity of this task remains poorly understood compared to its continuous counterpart. This paper demonstrates that D-NNT is fundamentally harder than previously realized. We show that while training shallow networks is NP-hard even under minimalist conditions, increasing network depth can push the problem beyond the complexity class NP. By reducing the Positive Straight-Line Program (PosSLP) problem to D-NNT, we establish that verifying optimal discrete weights in deep architectures may be computationally intractable, linking training hardness to fundamental questions in algebraic complexity and numerical instability.

Introduction

In modern machine learning, "quantization"—the process of restricting neural network weights to a small set of discrete values (e.g., $\{-1, 0, 1\}$)—is essential for running large-scale models on low-power devices. Despite its practical ubiquity, the theoretical landscape of discrete neural network training (D-NNT) has remained largely opaque. Most existing research focuses on continuous weights, where parameters can take any real value.

This research addresses three critical gaps in our understanding: the impact of network depth on training difficulty, the fundamental complexity difference between discrete and continuous training, and the feasibility of efficient algorithms for restricted versions of the problem. We find that depth is not merely a structural choice but a primary driver of computational hardness, potentially placing deep D-NNT outside the realm of problems that can even be verified in polynomial time.

Methodology: Mapping Complexity

The study employs classical computational complexity theory, utilizing polynomial reductions to map established "hard" problems onto the task of training a neural network.

For shallow, two-layer networks, the research utilizes reductions from combinatorial problems such as Subset Sum, Binary Constraint Satisfaction (2-CSP), and Exact Set Cover. These reductions allow the author to pinpoint the exact conditions under which training becomes difficult.

To address deep networks, the author introduces a novel reduction from the Positive Straight-Line Program (PosSLP) problem. PosSLP involves determining if a value produced by a sequence of arithmetic operations is positive. By demonstrating that a deep neural network can simulate these programs, the research connects D-NNT to deep questions in numerical analysis and algebraic complexity. This methodological bridge suggests that the numerical instability often observed by practitioners is a structural manifestation of the problem's underlying complexity.

The Hardness of Shallow Networks

A surprising result of this work is that D-NNT is NP-hard even in highly restricted, "minimalist" settings. The paper proves that the problem remains difficult even when:

  • The dataset consists of only a single data point ($n=1$).
  • The input dimension is one ($d=1$).
  • The activation function is a simple identity function ($\sigma(x) = x$).
  • The loss function is a standard sum of squares.

This demonstrates that the hardness of discrete training stems from the parameter constraints and the network architecture itself, rather than the complexity or volume of the data. Furthermore, while over-parameterization (having more neurons than data points) typically makes continuous models easier to fit, this paper shows that D-NNT remains NP-hard even when the model is significantly larger than the dataset.

Depth and the Escape from NP

The most significant insight of the research is the "Game-Changer" effect of depth. In computational complexity, NP-complete problems (like the Traveling Salesperson Problem) are those where a solution can be verified quickly even if it is hard to find.

Theorem 1.1 states that under standard conjectures, D-NNT for deep networks is not in NP. This means that for deep architectures, we likely cannot even verify if a given set of weights is optimal in polynomial time. This elevates D-NNT to a higher tier of difficulty than most standard combinatorial optimization problems. The ability of deep networks to represent and manipulate extremely fast-growing numbers—mirroring the behavior of PosSLP—is the primary mechanism that pushes the problem beyond NP.

Algorithmic Possibilities

Despite these daunting lower bounds, the research offers a "silver lining" for specific scenarios. The author provides a pseudo-polynomial algorithm for two-layer networks. This algorithm can solve D-NNT in time proportional to the maximum number the network can compute, provided the size of the dataset is fixed. While not a universal solution, it provides a theoretical path forward for specific, small-scale discrete training tasks.

Conclusion and Future Directions

This work redefines the theoretical boundaries of neural network training. By proving that depth can push discrete training out of NP, the research highlights a fundamental gap between continuous and discrete optimization.

However, several questions remain. The strongest results regarding deep networks rely on the Constructive Univariate Radical Conjecture, a widely accepted but unproven mathematical conjecture. Additionally, the current proofs for deep networks utilize custom activation functions capable of multiplication and division; future research is required to determine if standard activations like ReLU or Sigmoid yield the same "not in NP" result. Finally, while this paper focuses on worst-case adversarial hardness, bridging these bounds with the average-case performance of practical quantization algorithms remains a vital challenge for the field.

Summary updated

BibTeX
@inproceedings{doronarad2025hardness,
  author = {Ilan Doron-Arad},
  title = {{On the Hardness of Training Deep Neural Networks Discretely}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i15.33797},
}
Figure