arXiv:2610.11313cs.LGOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.11313

NP-Hardness of Minimizing Neurons in Two-Hidden-Layer ReLU Neural Networks

Sangrock Lee

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Sangrock Lee

Abstract—A fundamental question in neural network architecture optimization is whether the minimum hidden-neuron count required to approximate a target function within a prescribed tolerance can be computed efficiently. This paper resolves this question for two-hidden-layer ReLU networks under an Lp(Rd,Rm)L^p(\mathbb{R}^d, \mathbb{R}^m) approximation constraint. For every fixed d≥1d \geq 1, m≥1m \geq 1, and 1≤p<∞1 \leq p < \infty, we prove that computing the optimum exactly is NP-hard. The result holds even when the target is represented by a rational ReLU network whose realization is nonzero, componentwise nonnegative, compactly supported, globally Lipschitz, and continuous piecewise affine. The polynomial-time reduction from 3-SAT produces an architecture gap in which unsatisfiable formulas yield an optimum of zero, whereas satisfiable formulas yield an optimum of at least d+2d + 2. The proof constructs compactly supported polyhedral frustum functions realized by two-hidden-layer ReLU networks and establishes the LpL^p-density of finite linear combinations of box-frustum functions. The results offer theoretical justification for employing heuristic approximation methods in the design of ReLU neural networks, illustrating that attaining a minimal configuration within polynomial time is computationally unachievable.

Index Terms—NP-hardness, ReLU neural network, LpL^{p} function, 3-SAT.

1 INTRODUCTION

OPTIMIZING the number of neurons in deep learning architectures is critical for balancing computational efficiency and model performance. Oversized networks increase the risk of overfitting, while undersized ones may fail to capture essential data structures [1]. Given the extensive use of feedforward neural networks in applications such as image classification [2], [3], natural language processing [4], [5], and scientific computing [6], [7], there is a need for methods to design minimal yet effective models [8], [9]. Despite efforts through analytic approaches, heuristic methods, and complexity analysis, determining the optimal number of parameters remains unresolved. Our research examines the fundamental computational hurdles in optimizing ReLU network structures and provides a complexity-theoretic rationale for approximation-based methods in network design by proving a worst-case NP-hardness result for exact hidden-neuron minimization.

Extensive work has sought analytical descriptions of neural network architectures that achieve universal function approximation. Cybenko [10] showed that a single-hidden-layer network with sigmoid activation can approximate any continuous function on a compact domain arbitrarily well, provided that a sufficient finite number of hidden neurons is chosen according to the desired accuracy. Hornik et al. [11] extended this result to multilayer feedforward networks, establishing universality for Borel-measurable functions. Maiorov and Pinkus [12] showed that uniform approximation of any continuous function on a compact domain with a two-hidden-layer network requires a width that grows linearly with the input dimension. Their proof employs specially tailored sigmoidal activations; analytic, strictly monotone realizations of such functions are provided by Guliyev and Ismailov [13]. Because these activations are not standard choices like ReLU or tanh, they must be evaluated separately, which may limit practical applicability. Gripenberg [14] demonstrated that bounded width networks can achieve universality when depth is allowed to increase. Pinkus [15] surveys theoretical properties of multilayer feedforward neural networks, including universal approximation, derivative approximation, interpolation, and approximation bounds, with an emphasis on single-hidden-layer models and brief coverage of deeper architectures. Ismailov [16] reviews width-minimality results that depend on input dimension. In one dimension, with suitably chosen sigmoidal activations, a single hidden neuron can achieve uniform approximation, so the required width does not depend on target accuracy. For dimensions greater than one, for any fixed width, single-hidden-layer networks cannot approximate all continuous multivariate functions arbitrarily well, so the required width must increase as the accuracy requirement tightens. For two hidden layers and a computable sigmoidal activation, universality is attainable with width that grows linearly with the input dimension. Further studies [17], [18], [19] refined bounds on necessary network width for universal approximation. Park et al. [20] established minimal neuron requirements for ReLU networks for universal approximation in LpL^{p} space when the layer depth is allowed to grow. Cai [21] generalized the findings of Park et al. [20] to arbitrary activation functions. These analytical insights have advanced understanding, yet the precise configurations of neural networks with universal approximation capability remain under active investigation.

In addressing the challenge of determining the optimal configuration of neural networks, heuristic approaches have played a vital role, as evidenced by Neural Architecture Search (NAS). Zoph et al. [22] introduced a scalable and transferable NAS for image classification, utilizing a controller to enhance the search process's efficiency. Efficient

S. Lee (corresponding author) is with the FAMU–FSU College of Engineering, Florida State University, Tallahassee, FL, 32310. E-mail: sl22br@fsu.edu

Neural Architecture Search (ENAS) [23] accelerates the NAS process by sharing parameters among child models, thereby reducing the computational resources required for architecture search. Differentiable Architecture Search (DARTS) [24] demonstrates that NAS can be conducted through the optimization of network architectures via gradient descent within a continuous search space. Álvarez and Salzmann [25] introduced a method that dynamically optimizes the number of neurons in each layer during training by leveraging a group sparsity regularizer. Lee and Lee [26] presented NeuralScale, a framework employing iterative pruning and 'architecture descent' to optimize neuron configurations, improving accuracy in architecture-fixed settings. Kapanova et al. [27] proposed an evolutionary algorithm for neural network architecture search, considering neurons, layers, weights, and activation functions. Although significant progress has been made, identifying the optimal network size remains a challenging and unresolved problem in NAS, highlighting the complexity and exploratory nature of current methodologies.

Different aspects of neural networks are examined through the lens of computational complexity, using networks with various widths and depths. Blum and Rivest [28] demonstrate that the process of training a neural network, characterized by a single hidden layer with merely two nodes employing a step activation function and a single-node output, is classified as an NP-complete problem. This finding underscores the inherent computational difficulties that exist even in the most basic configurations of neural networks. Furthermore, this outcome has been generalized to scenarios involving the training of neural networks with ReLU activation functions [29], [30]. Froese and Hertrich [31] have shown that the training of neural networks is NP-hard in fixed dimensions. Bertschinger et al. [32] established that training a neural network with a single hidden layer is ∃R\exists R-complete. Despite these insights, the complexity aspects of structural optimization in neural network models remain largely unexplored.

This paper establishes that exact minimization of the hidden-neuron count in two-hidden-layer ReLU networks is NP-hard for every fixed input dimension d≥1d \geq 1, every fixed output dimension m≥1m \geq 1, and every 1≤p<∞1 \leq p < \infty. The result holds even for rational target networks whose realizations are nonzero, componentwise nonnegative, compactly supported, globally Lipschitz, and continuous piecewise affine. The reduction distinguishes instances with optimum zero from instances with optimum at least d+2d + 2. This result identifies a worst-case computational obstruction to exact architecture selection and provides a complexity-theoretic basis for heuristic, approximate, or restricted architecture-selection methods for ReLU neural networks.

The remainder of this paper is organized as follows. Section II fixes the notation for ReLU neural networks, hidden-layer widths, total neuron counts, and bounded polytopes. Section III constructs compactly supported polyhedral frustum functions from bounded polytopes and shows that these functions are realized by two-hidden-layer ReLU networks. Section IV proves that finite linear combinations of compactly supported box-frustum functions are dense in Lp(Rd)L^{p}(\mathbb{R}^{d}) and extends this approximation result to vector-valued functions. Section V defines the exact two-hidden-layer neuron minimization problem, proves an LpL^{p} degeneracy result for networks of width at most the input dimension, constructs a satisfiability-dependent target with a nonzero nonnegative baseline, and derives an architecture gap that implies NP-hardness. Section VI concludes with implications for exact architecture selection and heuristic network design.

References (32)