Training Neural Networks is NP-Hard in Fixed Dimension
We study the parameterized complexity of training two-layer neural networks
with respect to the dimension of the input data and the number of hidden
neurons, considering ReLU and linear threshold activation functions. Albeit the
computational complexity of these problems has been studied numerous times in
recent years, several questions are still open. We answer questions by Arora et
al. [ICLR '18] and Khalife and Basu [IPCO '22] showing that both problems are
NP-hard for two dimensions, which excludes any polynomial-time algorithm for
constant dimension. We also answer a question by Froese et al. [JAIR '22]
proving W[1]-hardness for four ReLUs (or two linear threshold neurons) with
zero training error. Finally, in the ReLU case, we show fixed-parameter
tractability for the combined parameter number of dimensions and number of
ReLUs if the network is assumed to compute a convex map. Our results settle the
complexity status regarding these parameters almost completely.
Vincent Froese, Christoph Hertrich
# Training Neural Networks is NP-Hard in Fixed Dimension

###### Abstract

We study the parameterized complexity of training two-layer neural networks with respect to the dimension of the input data and the number of hidden neurons, considering ReLU and linear threshold activation functions. Albeit the computational complexity of these problems has been studied numerous times in recent years, several questions are still open. We answer questions by Arora et al. [ICLR '18] and Khalife and Basu [IPCO '22] showing that both problems are NP-hard for two dimensions, which excludes any polynomial-time algorithm for constant dimension. We also answer a question by Froese et al. [JAIR '22] proving W[1]-hardness for four ReLUs (or two linear threshold neurons) with zero training error. Finally, in the ReLU case, we show fixed-parameter tractability for the combined parameter number of dimensions and number of ReLUs if the network is assumed to compute a convex map. Our results settle the complexity status regarding these parameters almost completely.

## 1 Introduction

Neural networks with rectified linear unit (ReLU) activations are arguably one of the most fundamental models in modern machine learning [2, 13, 21]. To use them as predictors on unseen data, one usually first fixes an architecture (the graph of the neural network) and then optimizes the weights and biases such that the network performs well on some known training data, with the hope that it will then also generalize well to unseen test data. While the ultimate goal in applications is generalization, _empirical risk minimization_ (that is, optimizing the training error) is an important step in this pipeline and understanding its computational complexity is crucial to advance the theoretical foundations of deep learning.
In this paper, we aim to understand how the choice of different meta-parameters, like the input dimension and the width of the neural network, influences the computational complexity of the training problem. To this end, we focus on two-layer neural networks, which can be seen as the standard building block also for deeper architectures.

Formally, a two-layer neural network (see Figure 1) with \(d\) input neurons, \(k\) hidden ReLU neurons, and a single output neuron computes a map

\[\phi\colon\mathbb{R}^{d}\to\mathbb{R},\quad\phi(\mathbf{x})=\sum_{j=1}^{k}a_{j} [\mathbf{w}_{j}\cdot\mathbf{x}+b_{j}]_{+},\]

where \(\mathbf{w}_{j}\in\mathbb{R}^{d}\) and \(a_{j}\in\{-1,1\}\) are the weights between the layers, \(b_{j}\) are the biases at the hidden neurons, and \([x]_{+}\coloneqq\max(0,x)\) is the _rectifier_ function. Notice that restricting \(a_{j}\) to \(\{-1,1\}\) is without loss of generality because we can normalize by pulling any nonnegative factor into \(\mathbf{w}_{j}\) and \(b_{j}\). We also study neural networks with _linear threshold activation_ in Section 5.

Given training data \(\mathbf{x}_{1},\ldots,\mathbf{x}_{n}\in\mathbb{R}^{d}\) with labels \(y_{1},\ldots,y_{n}\in\mathbb{R}\), the task of training such a network is to find \(\mathbf{w}_{j},b_{j}\), and \(a_{j}\) for each \(j\in[k]\) such that the training error \(\sum_{i=1}^{n}\ell(\phi(\mathbf{x}_{i}),\ y_{i})\) for a given loss function \(\ell\colon\mathbb{R}\times\mathbb{R}\to\mathbb{R}_{\geq 0}\) is minimized. Formally, the decision version of two-layer ReLU neural network training is defined as follows:

\begin{tabular}{l l} \(2\)L-ReLU-NN-Train(\(\ell\)) \\
**Input:** & Data points \((\mathbf{x}_{1},y_{1}),\ldots,(\mathbf{x}_{n},y_{n})\in\mathbb{R}^{d}\times \mathbb{R}\), a number \(k\in\mathbb{N}\) of ReLUs, \\  & and a target error \(\gamma\in\mathbb{R}_{\geq 0}\). \\
**Question:** & Are there weights \(\mathbf{w}_{1},\ldots,\mathbf{w}_{k}\in\mathbb{R}^{d}\), biases \(b_{1},\ldots,b_{k}\in\mathbb{R}\), and coefficients \(a_{1},\ldots,a_{k}\in\{-1,1\}\) such that \\ \end{tabular}

Note that in the over-parameterized case where \(k\geq n\), the network can exactly fit any \(n\) input points1 (achieving training error \(\gamma=0\)) [24, Theorem 1]. Thus, we henceforth

Figure 1: Neural network architecture we study in this paper: After the input layer (left) with \(d\) input neurons, we have one hidden layer with \(k\) ReLU neurons and a single output neuron without additional activation function.
assume that \(k<n\).

2L-ReLU-NN-Train(\(\ell\)) is known to be NP-hard [8, 15], but all known reductions require the input dimension to be part of the input. The current state-of-the-art exact algorithm for convex loss \(\ell\) is by Arora et al. [2] and runs in \(O(2^{k}n^{dk}\operatorname{poly}(L))\) time, where \(L\) is the input bit-length.

As regards the computational complexity of 2L-ReLU-NN-Train(\(\ell\)), Arora et al. [2] posed the question(s) whether a running time

_"that is polynomial in the data size and/or the number of hidden nodes, assuming that the input dimension is a fixed constant"_

is possible. That is, they asked two questions. The first corresponds to the "and" statement, which can be phrased as follows:

**Question 1**: Is there an algorithm running in \((nk)^{f(d)}\operatorname{poly}(L)\) time for some function \(f\)?

In other words, the question is whether 2L-ReLU-NN-Train(\(\ell\)) is in the complexity class XP when parameterized by \(d\). The second question corresponding to the "or" statement can then be interpreted as

**Question 2**: Is there an algorithm running in \(n^{f(d)}g(k,d)\operatorname{poly}(L)\) or \(k^{f(d)}g(n,d)\operatorname{poly}(L)\) time for some functions \(f\) and \(g\)?

We observe that the second running time is clearly possible since \(k<n\) holds by assumption, and hence the algorithm by Arora et al. [2] runs in \(g(n,d)\operatorname{poly}(L)\) time. Hence, it remains open whether \(n^{f(d)}g(k,d)\operatorname{poly}(L)\) time is possible, which is equivalent to (uniform) fixed-parameter tractability with respect to \(k\) for every constant \(d\).

Clearly, Question 1 is the stronger statement, that is, a positive answer implies a positive answer to Question 2. Arora et al. [2] conclude with

_"Resolving this dependence on network size would be another step towards clarifying the theoretical complexity of training ReLU DNNs and is a good open question for future research, in our opinion."_

Note that Froese et al. [10] proved that, for \(k=1\), there is no algorithm running in \(g(d)n^{o(d)}\) time unless the Exponential Time Hypothesis fails. Hence, this result already partially answered the two questions above by excluding any algorithm running in \(n^{o(d)}g(d,k)\operatorname{poly}(L)\) time.

In this paper, we answer Question 1 negatively by showing NP-hardness for \(d=2\) in Theorem 1, indicating that we cannot get rid of the exponential dependence on the network size in the algorithm by Arora et al. [2] even if the dimension is fixed. As regards Question 2, we further exclude (assuming the Exponential Time Hypothesis) any algorithm running in time \(n^{o(d)}g(d,k)\operatorname{poly}(L)\) even for the case \(\gamma=0\) and prove W[1]-hardness with respect to \(d\) for \(k=4\) (Theorem 7), which answers an open question by Froese et al. [10].

We also obtain analogous hardness results if linear threshold activation functions are used instead of ReLUs. As in the ReLU case, it is well-known that training linear threshold networks is NP-hard [4, 20]. The running time of the state-of-the-art algorithm
due to Khalife and Basu [20] is polynomial in \(n\) for fixed \(d\) and \(k\), but exponential in the latter two parameters. Khalife and Basu [20] posed an analogous question to Question 1 for linear threshold networks, which we answer negatively in Corollary 8, excluding a polynomial running time even for fixed dimension. We also show that we cannot expect fixed-parameter tractability with respect to \(d\) even for \(k=1\) (Corollary 9) and also not for \(k=2\) and \(\gamma=0\) (Corollary 10).

On the positive side, we give an algorithm running in \(2^{O(k^{2}d)}\operatorname{poly}(k,L)\) time for ReLU neural networks if \(\gamma=0\) and the function computed by the network is assumed to be convex (Theorem 11). Note that this running time yields fixed-parameter tractability with respect to \(k\) for every constant \(d\), and thus answers Question 2 positively for this restricted special case.

Implications and Limitations.In the following we provide a brief discussion of the implications and limitations of our results from various perspectives.

##### Input Dimension.

Theorem 1 implies that 2L-ReLU-NN-Train(\(\ell\)) is in fact NP-hard for every fixed \(d\geq 2\). The straight-forward reduction simply pads all the input vectors with \(d-2\) zeros. Similarly, Corollary 8 holds for every fixed \(d\geq 2\).

##### Target Error.

The hardness results Theorems 1 and 7 and Corollaries 8 and 10 also hold for every fixed \(\gamma\geq 0\). The reduction is straight-forward by introducing a set of incompatible data points which force the network to incur an additional error of \(\gamma\). For our positive result Theorem 11, however, there is indeed a difference in the complexity between the two cases \(\gamma=0\) and \(\gamma>0\). While we show fixed-parameter tractability for \(\gamma=0\), the same problem is W[1]-hard for \(\gamma>0\), already in the case \(k=1\)[10].

##### Number of ReLUs.

It is not too difficult to see (although it requires some work) that our particular reduction in Theorem 7 can be extended to any \(k\geq 4\) by introducing more data points far away from the existing data points which enforce the usage of additional ReLUs which then cannot be used to fit the data points of the actual reduction. Therefore, Theorem 7 holds for every fixed \(k\geq 4\). Similarly, Corollary 9 holds for every fixed \(k\geq 1\) and Corollary 10 holds for every fixed \(k\geq 2\).

##### Other Activation Functions.

Our hardness results hold for the piecewise linear ReLU activation function and the piecewise constant linear threshold activation function. Extending them to other piecewise linear or constant activation functions like leaky ReLU or maxout should be straight-forward. However, achieving analogous results for smooth activation functions like sigmoids probably requires fundamentally different techniques and is beyond the scope of this paper.

##### Training vs. Learning.

Our results are concerned with the problem of minimizing the training error. While this is inherently different from minimizing the generalization error, there are indeed deep connections between these two problems [23]. In particular, as pointed out by Goel et al. [15], hardness of training implies hardness of proper learning if one permits arbitrary data distributions. However, such hardness results can often be
overcome by either posing additional assumptions on the data distributions or switching to more general learning paradigms like improper learning [14].

##### Exact vs. Approximate Training.

In practice, it arguably often suffices to train a neural network to approximate instead of exact optimality. The results in this paper are concerned with solving the training problem to exact global optimality. However, since Theorems 1 and 7 and Corollaries 8 and 10 already hold for training error \(\gamma=0\), they even rule out the existence of approximation algorithms with any multiplicative factor. We conceive that for appropriate notions of _additive_ approximation (see, e.g., [15]), our reductions can also be used to show hardness of additive approximation. However, this would significantly increase the technical complexity of the analysis and is therefore beyond the scope of this paper. We leave it as an open research question to analyze the influence of meta-parameters like input dimension and number of hidden neurons on additive approximation of the training problem.

##### Related Work.

Dey et al. [8] and Goel et al. [15] showed NP-hardness of 2L-ReLU-NN-Train(\(\ell\)) for \(k=1\), but require non-constant dimension. For target error \(\gamma=0\), the problem is NP-hard for every constant \(k\geq 2\) and polynomial-time solvable for \(k=1\)[15]. Goel et al. [15] provide further conditional running time lower bounds and (additive) approximation hardness results. Froese et al. [10] considered the parameterized complexity regarding the input dimension \(d\) and proved W[1]-hardness and an ETH-based running time lower bound of \(n^{\Omega(d)}\) for \(k=1\).

Boob et al. [5] studied networks where the output neuron also is a ReLU and proved NP-hardness (and implicitly W[1]-hardness with respect to \(d\)) for \(k=2\) and \(\gamma=0\). Bertschinger et al. [3] showed that training 2-layer ReLU networks with two output and two input neurons (\(\mathbb{R}^{2}\rightarrow\mathbb{R}^{2}\)) is complete for the class \(\exists\mathbb{R}\) (existential theory of the reals) and thus likely not contained in NP. This also implies NP-hardness, but note that in contrast to our results, their reduction does not work for one-dimensional outputs. Their result strengthens a previous result by Abrahamsen et al. [1] who proved \(\exists\mathbb{R}\)-completeness for networks with a specific (not fully connected) architecture. Pilanci and Ergen [22] showed that training 2-layer neural networks can be formulated as a convex program which yields a polynomial-time algorithm for constant dimension \(d\). However, they considered a regularized objective and their result requires the number \(k\) of hidden neurons to be very large (possibly equal to the number \(n\) of input points) and hence does not contradict our NP-hardness result for \(d=2\).

To study the computational complexity of training ReLU networks, a crucial ingredient is to know the set of (continuous and piecewise linear) functions precisely representable with a certain network architecture. This is well-understood for two-layer networks [2, 3, 7], but much trickier for deeper networks [16, 17, 18]. Similar to the study of ReLU networks by Arora et al. [2], Khalife and Basu [20] studied the expressiveness and training complexity for linear threshold activation functions.
Preliminaries

Notation.For \(n\in\mathbb{N}\), we define \([n]\coloneqq\{1,\ldots,n\}\). For \(X\subseteq\mathbb{R}^{d}\), we denote by \(\operatorname{aff}(X)\) the affine hull of \(X\) and by \(\dim(X)\) the dimension of \(\operatorname{aff}(X)\).

Throughout this work, we assume \(\ell\colon\mathbb{R}\times\mathbb{R}\to\mathbb{R}_{\geq 0}\) to be any loss function with \(\ell(x,y)=0\iff x=y\).

Parameterized Complexity.We assume basic knowledge on computational complexity theory. Parameterized complexity is a multivariate approach to analyze the computational complexity of problems [9, 6].

An instance \((x,k)\) of a parameterized problem \(L\subseteq\Sigma^{*}\times\mathbb{N}\) is a pair with \(x\in\Sigma^{*}\) being a problem instance and \(k\in\mathbb{N}\) being the value of a certain _parameter_. A parameterized problem \(L\) is _fixed-parameter tractable (fpt)_ (contained in the class FPT) if there exists an algorithm deciding whether \((x,k)\in L\) in \(f(k)\cdot|x|^{O(1)}\) time, where \(f\) is a function solely depending on \(k\). Note that a parameterized problem in FPT is polynomial-time solvable for every constant parameter value where, importantly, the degree of the polynomial does not depend on the parameter value. The class XP contains all parameterized problems which can be solved in polynomial time for constant parameter values, that is, in time \(f(k)\cdot|x|^{g(k)}\). It is known that \(\operatorname{FPT}\subsetneq\operatorname{XP}\). The class \(\operatorname{W}[1]\) contains parameterized problems which are widely believed not to be in FPT. That is, a \(\operatorname{W}[1]\)-hard problem (e.g. Clique parameterized by the size of the sought clique) is not solvable in \(f(k)\cdot|x|^{O(1)}\) time. It is known that \(\operatorname{FPT}\subseteq\operatorname{W}[1]\subseteq\operatorname{XP}\).

\(\operatorname{W}[1]\)-hardness is defined via _parameterized reductions_. A parameterized reduction from \(L\) to \(L^{\prime}\) is an algorithm mapping an instance \((x,k)\) in \(f(k)\cdot|x|^{O(1)}\) time to an instance \((x^{\prime},k^{\prime})\) such that \(k^{\prime}\leq g(k)\) for some function \(g\) and \((x,k)\in L\) if and only if \((x^{\prime},k^{\prime})\in L^{\prime}\).

Exponential Time Hypothesis.The Exponential Time Hypothesis (ETH) [19] states that 3-SAT cannot be solved in subexponential time in the number \(n\) of Boolean variables in the input formula, that is, there exists a constant \(c>0\) such that 3-SAT cannot be solved in \(O(2^{cn})\) time.

The ETH implies \(\operatorname{FPT}\neq\operatorname{W}[1]\)[6] (which implies \(\operatorname{P}\neq\operatorname{NP}\)). In fact, ETH implies that Clique cannot be solved in \(\rho(k)\cdot n^{o(k)}\) time for any function \(\rho\), where \(k\) is the size of the sought clique and \(n\) is the number of vertices in the graph [6].

Geometry of 2-Layer ReLU Networks.For proving our results, it is crucial to understand the geometry of a function \(\phi\colon\mathbb{R}^{d}\to\mathbb{R}\) represented by a two-layer ReLU network. Here, we only discuss properties required to understand our results and refer to [2, 3, 7] for additional discussions in this context. Such a function \(\phi\) is a continuous and piecewise linear function. Each hidden neuron with index \(j\in[k]\) defines a hyperplane \(\mathbf{w}_{j}\cdot\mathbf{x}+b_{j}=0\) in \(\mathbb{R}^{d}\). These \(k\) hyperplanes form a hyperplane arrangement. Inside each cell of this hyperplane arrangement, the function \(\phi\) is affine. The graph of \(\phi\) restricted to such a cell is called a _(linear) piece_ of \(\phi\).

Consider a hyperplane \(H\) from the hyperplane arrangement. Let \(\mathbf{w}\) be an orthonormal vector of \(H\) and let \(J\subseteq[k]\) be the non-empty subset of indices of neurons which induce precisely \(H\). Note that \(\mathbf{w}_{j}\) is a scaled version of \(\mathbf{w}\) for each \(j\in J\). Let \(\mathbf{x}\in\mathbb{R}^{d}\) be
a point on \(H\) which does not lie on any other hyperplane in the arrangement. There are exactly two full-dimensional cells in the arrangement containing \(\mathbf{x}\): one on each side of \(H\). The difference of the directional derivatives of the corresponding two pieces of \(\phi\) in the direction of \(\mathbf{w}\) is exactly \(\sum_{j\in J}a_{j}\|\mathbf{w}_{j}\|\). In particular, this is independent of \(\mathbf{x}\) and therefore constant along \(H\). If this value is positive, we say that \(H\) is a _convex_ hyperplane of \(\phi\). If it is negative, we say that \(H\) is a _concave_ hyperplane of \(\phi\). Note that this matches with \(\phi\) being convex or concave locally around every point \(\mathbf{x}\in H\) which does not belong to any other hyperplane in the arrangement. Moreover, a point \(\mathbf{x}\in\mathbb{R}^{d}\) is called a convex (concave) _breakpoint_ of \(\phi\) if it lies on a convex (concave) hyperplane of \(\phi\).

One important observation we will heavily use is the following: If we know that \(\phi\) originates from a 2-layer neural network with \(k\) hidden neurons and we know that we need indeed \(k\) distinct hyperplanes to separate the pieces of \(\phi\), then each hyperplane must be induced by exactly one neuron (and not several). Then the hyperplane corresponding to the \(j\)-th neuron is convex if and only if \(a_{j}>0\) and concave if and only if \(a_{j}<0\). For input dimension \(d=2\), each of the hyperplanes in the arrangement is actually a line in \(\mathbb{R}^{2}\). We call such a line a _breakline_ and define _convex_ and _concave_ breaklines accordingly.

## 3 NP-Hardness for Two Dimensions

In this section we prove our main result that 2L-ReLU-NN-Train\((\ell)\) is NP-hard for two dimensions, thus excluding any running time of the form \((nk)^{f(d)}\).

**Theorem 1**.: \(2\)L-ReLU-NN-Train\((\ell)\) _is NP-hard even for \(d=2\) and \(\gamma=0\)._

We give a polynomial-time reduction from the following NP-complete problem [11].

Positive One-In-Three 3-SAT (POITS)

**Input:**: A Boolean formula \(F\) in conjunctive normal form with three positive literals per clause.
**Question:**: Is there a truth assignment for the variables such that each clause in \(F\) has exactly one true literal?

Our construction will be such that the function represented by the neural network is equal to zero everywhere except for a finite set of "stripes", in which the function forms a _levee_ (see Definition 2), that is, when looking at a cross section, the function goes up from 0 to 1, stays constant for a while, and goes down from 1 to 0 again. See Figure 2 (right) for a top view of a levee and Figure 3 for a cross section of a levee.

**Definition 2**.: _A levee with slope \(s\in\mathbb{R}\) (centered at the origin) is the function \(f_{s}\colon\mathbb{R}^{2}\to\mathbb{R}\) with_

\[f_{s}(x_{1},x_{2})=\left\{\begin{array}{ll}0,&\mbox{if }|x_{2}-sx_{1}| \geq 2,\\ 1,&\mbox{if }|x_{2}-sx_{1}|\leq 1,\\ 2+x_{2}-sx_{1},&\mbox{if }x_{2}-sx_{1}\in\,]-2,-1[,\\ 2-x_{2}+sx_{1},&\mbox{if }x_{2}-sx_{1}\in\,]1,2[.\end{array}\right. \tag{1}\]

**Observation 3**.: _A leveee \(f_{s}\) is a continuous, piecewise linear function with two convex and two concave breaklines. It can be realized with four ReLUs as follows:_

\[f_{s}(x_{1},x_{2})=[x_{2}-sx_{1}+2]_{+}-[x_{2}-sx_{1}+1]_{+}-[x_{2}-sx_{1}-1]_ {+}+[x_{2}-sx_{1}-2]_{+}.\]
Similar levees have been used by Bertschinger et al. [3] to prove \(\exists\mathbb{R}\)-completeness of neural network training, however, in a conceptually very different way. In their work, levees encode variable values via the _slopes of the function_ on the non-constant regions of the levee. In contrast, in our reduction, we encode discrete choices via rotation of the levees, that is, via the _slopes of the breaklines in the two-dimensional input space_.

Selection Gadget.We describe a gadget allowing us to model a discrete choice between \(\ell\) many possibilities (levees). We will describe the gadget centered at the origin of the \(x_{1}\)-\(x_{2}\)-plane. Later in our reduction, we will use several shifted versions of this gadget. An illustration of the selection gadget is given in Figure 2.

Each of the \(\ell\) different choices corresponds to one of \(\ell\) different slopes \(s_{1}<s_{2}<\dots<s_{\ell}\). First, we place 13 data points on the \(x_{2}\)-axis (with \(x_{1}=0\), we call this vertical line \(h_{0}\)):

\begin{tabular}{c|c c c c c c c c c c c} \(x_{2}\) & \(-4\) & \(-3\) & \(-2\) & \(-\nicefrac{{5}}{{3}}\) & \(-\nicefrac{{4}}{{3}}\) & \(-1\) & \(0\) & \(1\) & \(\nicefrac{{4}}{{3}}\) & \(\nicefrac{{5}}{{3}}\) & \(2\) & \(3\) & \(4\) \\ \hline \(y\) & \(0\) & \(0\) & \(0\) & \(\nicefrac{{1}}{{3}}\) & \(\nicefrac{{2}}{{3}}\) & \(1\) & \(1\) & \(1\) & \(\nicefrac{{2}}{{3}}\) & \(\nicefrac{{1}}{{3}}\) & \(0\) & \(0\) & \(0\) \\ \end{tabular}

Next, we need a small \(\epsilon>0\) to be chosen later in a global context. The only condition we impose on \(\epsilon\) in order to make the selection gadget work is that \(\epsilon\leq\min\Bigl{\{}\frac{1}{3|s_{1}|},\frac{1}{3|s_{\ell}|}\Bigr{\}}\). Based on this, we place 9 data points parallel to the \(x_{2}\)-axis with \(x_{1}=-\epsilon\) (we call the corresponding vertical line \(h_{-\epsilon}\)):

\begin{tabular}{c|c c c c c c c c c} \(x_{2}\) & \(-4-\epsilon s_{\ell}\) & \(-3-\epsilon s_{\ell}\) & \(-2-\epsilon s_{\ell}\) & \(-1-\epsilon s_{1}\) & \(0\) & \(1-\epsilon s_{\ell}\) & \(2-\epsilon s_{1}\) & \(3-\epsilon s_{1}\) & \(4-\epsilon s_{1}\) \\ \hline \(y\) & \(0\) & \(0\) & \(0\) & \(1\) & \(1\) & \(1\) & \(0\) & \(0\) & \(0\) \\ \end{tabular}

Furthermore, similar to above, we place 9 data points parallel to the \(x_{2}\)-axis with \(x_{1}=\epsilon\) (we call the corresponding line \(h_{\epsilon}\)):

\begin{tabular}{c|c c c c c c c c} \(x_{2}\) & \(-4+\epsilon s_{1}\) & \(-3+\epsilon s_{1}\) & \(-2+\epsilon s_{1}\) & \(-1+\epsilon s_{\ell}\) & \(0\) & \(1+\epsilon s_{1}\) & \(2+\epsilon s_{\ell}\) & \(3+\epsilon s_{\ell}\) & \(4+\epsilon s_{\ell}\) \\ \hline \(y\) & \(0\) & \(0\) & \(0\) & \(1\) & \(1\) & \(1\) & \(0\) & \(0\) & \(0\) \\ \end{tabular}

Finally, we place \(2(\ell-1)\) many data points as follows: for each \(i\in[\ell-1]\), we introduce one data point \(\mathbf{q}_{i}^{-}\coloneqq(-\frac{4}{s_{i+1}-s_{i}},-\frac{2(s_{i}+s_{i+1})}{ s_{i+1}-s_{i}})\), as well as one data point \(\mathbf{q}_{i}^{+}\coloneqq(\frac{4}{s_{i+1}-s_{i}},\frac{2(s_{i}+s_{i+1})}{s_ {i+1}-s_{i}})\). All these data points receive label \(y=0\).

It is not too difficult to verify that a levee with slope \(s_{i}\), \(i\in[\ell]\), fits all data points of a selection gadget. We omit the simple but tedious calculations here. More intricately, the following lemma shows that a selection gadget indeed models a discrete choice between exactly \(\ell\) possibilities.

**Lemma 4**.: _Let \(f\colon\mathbb{R}^{2}\to\mathbb{R}\) be a continuous piecewise linear function with only four breaklines that fits all the data points of the selection gadget. Then, \(f=f_{s_{i}}\) for some \(i\in[\ell]\)._

Proof.: First, we focus on the three vertical lines \(h_{-\epsilon}\), \(h_{0}\), and \(h_{\epsilon}\). Note each of the three lines contains a sequence of nine data points of which the first three have label 0, the next three have label 1 and the final three have label 0 again. For simplicity, consider one of the three lines and denote these nine data points by \(\mathbf{p}_{1}\) to \(\mathbf{p}_{9}\). Note that \(h_{0}\) contains
even more data points, which will become important later. For the following argument, compare Figure 3.

Observe that \(f\) restricted to one of the three lines is a one-dimensional, continuous, piecewise linear function with at most four breakpoints. Looking at \(\mathbf{p}_{2}\), \(\mathbf{p}_{3}\), and \(\mathbf{p}_{4}\), the corresponding \(y\)-labels are \(0\), \(0\), and \(1\), respectively. This can only be fitted if there exists a convex breakpoint between \(\mathbf{p}_{2}\) and \(\mathbf{p}_{4}\). Analogously, there must be a concave breakpoint between \(\mathbf{p}_{3}\) and \(\mathbf{p}_{5}\), another concave breakpoint between \(\mathbf{p}_{5}\) and \(\mathbf{p}_{7}\), and a convex breakpoint between \(\mathbf{p}_{6}\) and \(\mathbf{p}_{8}\). This uses already all four available breakpoints, so there are no other breakpoints. Therefore, the function on the considered line must be linear outside the segment between \(\mathbf{p}_{2}\) and \(\mathbf{p}_{8}\). Since \(\mathbf{p}_{1}\), \(\mathbf{p}_{2}\), \(\mathbf{p}_{8}\), and \(\mathbf{p}_{9}\) all have label \(0\), it follows that the function is constant \(0\) outside this segment. Moreover, there is no concave breakpoint outside the segment between \(\mathbf{p}_{3}\) and \(\mathbf{p}_{7}\), implying that the function

Figure 3: Cross section of the selection gadget through one of the three lines \(h_{-\epsilon}\), \(h_{0}\), or \(h_{\epsilon}\). The nine data points (labeled \(\mathbf{p}_{1}\) to \(\mathbf{p}_{9}\)) on each of these lines force the function \(f\) to attain a “levee-shape” with the exact position and slope of the ascending and descending sections as the only degrees of freedom (left). The four additional data points on \(h_{0}\) even fix these properties and thus exactly determine \(f\) on that line (right).

Figure 2: Illustration of the selection gadget with \(\ell=3\) and \(s_{1}=-1\), \(s_{2}=0\), \(s_{3}=1\). Both figures show the \(x_{1}\)-\(x_{2}\)-plane while the \(y\)-coordinate is indicated via the darkness of the gray color. The left picture shows all data points belonging to the gadget as well as the breaklines of the three possible levees fitting the data points. In addition to these features, the right picture shows a levee with slope \(s_{2}=0\) as one of three possibilities to fit the data points of the gadget.
must be convex outside the segment between \(\mathbf{p}_{3}\) and \(\mathbf{p}_{7}\). However, since these two points have label \(0\) as well, it follows that \(f\) must even be constant \(0\) there.

Now consider the segment between \(\mathbf{p}_{4}\) and \(\mathbf{p}_{6}\). There is no convex breakpoint between \(\mathbf{p}_{4}\) and \(\mathbf{p}_{6}\). Therefore, the function must be concave within the segment. Since \(\mathbf{p}_{4}\), \(\mathbf{p}_{5}\), and \(\mathbf{p}_{6}\) all have label \(1\), it follows that the function is constant \(1\) between \(\mathbf{p}_{4}\) and \(\mathbf{p}_{6}\).

Putting together the insights gained so far, it follows that \(f\) restricted to the considered line is constant \(0\) first, goes up to constant \(1\) via a convex and a concave breakpoint between \(\mathbf{p}_{3}\) and \(\mathbf{p}_{4}\), and goes down to constant \(0\) again via a concave and a convex breakpoint between \(\mathbf{p}_{6}\) and \(\mathbf{p}_{7}\) (Figure 3, left). Note that the exact location of these breakpoints and the slope in the sloped segments is not implied by the nine data points considered so far.

This changes, however, when also taking into account the four other data points lying on \(h_{0}\). Combined with the insights so far, they completely determine \(f\) on this line (Figure 3, right):

\[f(0,x_{2})=\left\{\begin{array}{ll}0,&\mbox{if $x_{2}\leq-2$ or $x_{2}\geq 2$,}\\ 1,&\mbox{if $-1\leq x_{2}\leq 1$,}\\ 2+x_{2},&\mbox{if $-2\leq x_{2}\leq-1$,}\\ 2-x_{2},&\mbox{if $1\leq x_{2}\leq 2$.}\end{array}\right.\]

Observe that this is precisely the same as (1) with \(x_{1}=0\).

It remains to consider the behavior of \(f\) on both sides of \(h_{0}\). To this end, observe that the breakpoints of \(f\) restricted to one of the three lines considered so far emerge as intersections of these lines with only four breaklines in total. Let us collect what we know so far about the locations of these four breaklines:

* There are exactly two convex breaklines, intersecting \(h_{0}\) at \((0,-2)\) and \((0,2)\), respectively. We call them \(g_{1}\) and \(g_{4}\), respectively.
* There are exactly two concave breaklines, intersecting \(h_{0}\) at \((0,-1)\) and \((0,1)\), respectively. We call them \(g_{2}\) and \(g_{3}\), respectively.
* Each of the four segments \[I_{1} \coloneqq[(-\epsilon,-2-\epsilon s_{\ell}),(-\epsilon,-1-\epsilon s _{1})]\subseteq[(-\epsilon,-\nicefrac{{7}}{{3}}),(-\epsilon,-\nicefrac{{2}}{ {3}})],\] \[I_{2} \coloneqq[(-\epsilon,1-\epsilon s_{\ell}),(-\epsilon,2-\epsilon s _{1})]\subseteq[(-\epsilon,\nicefrac{{2}}{{3}}),(-\epsilon,\nicefrac{{7}}{{3 }})],\] \[I_{3} \coloneqq[(\epsilon,-2+\epsilon s_{1}),(\epsilon,-1+\epsilon s_{ \ell})]\subseteq[(\epsilon,-\nicefrac{{7}}{{3}}),(\epsilon,-\nicefrac{{2}}{{3 }})],\mbox{ and}\] \[I_{4} \coloneqq[(\epsilon,1+\epsilon s_{1}),(\epsilon,2+\epsilon s_{ \ell})]\subseteq[(\epsilon,\nicefrac{{2}}{{3}}),(\epsilon,\nicefrac{{7}}{{3 }})]\] is intersected by exactly one concave and one convex breakline. Here, the inclusions are implied by \(\epsilon\leq\min\Bigl{\{}\frac{1}{3|s_{1}|},\frac{1}{3|s_{\ell}|}\Bigr{\}}\). See Figure 4 for an illustration of the position of these segments.

Now consider \(g_{2}\), which goes through \((0,-1)\), and observe that it cannot intersect \(I_{2}\) for the following reason. If it did, it would intersect \(h_{\epsilon}\) at \(x_{2}\leq-1-\nicefrac{{5}}{{3}}=-\nicefrac{{8}}{{3}}<-\nicefrac{{7}}{{3}}\) and hence would neither intersect \(I_{3}\) nor \(I_{4}\). This is a contradiction because there are only two concave breaklines and both \(I_{3}\) and \(I_{4}\) must be intersected by exactly one of them. Consequently, \(g_{2}\) cannot intersect \(I_{2}\), and must intersect \(I_{1}\) instead.
Analogously, it follows that \(g_{1}\) and \(g_{2}\) intersect \(I_{1}\) and \(I_{3}\). Similarly, \(g_{3}\) and \(g_{4}\) intersect \(I_{2}\) and \(I_{4}\). Combining this with the fact that \(f\) restricted to each of the three vertical lines \(h_{-\epsilon}\), \(h_{0}\), and \(h_{\epsilon}\) has an increasing section from \(0\) to \(1\) and a decreasing section from \(1\) to \(0\), this implies that the four lines \(g_{1}\) to \(g_{4}\) do not cross between \(h_{-\epsilon}\) and \(h_{\epsilon}\). Let us focus on the quadrilateral enclosed by \(g_{1}\), \(g_{2}\), \(h_{-\epsilon}\) and \(h_{\epsilon}\). By what we know so far, \(f\) is constant \(0\) on \(g_{1}\), constant \(1\) on \(g_{2}\), and linear within this quadrilateral. Since \(h_{-\epsilon}\) and \(h_{\epsilon}\) are parallel, this implies that the corresponding two sides of the quadrilateral must have the same length. Thus, the quadrilateral must be a parallelogram. In particular, \(g_{1}\) and \(g_{2}\) are parallel. Similarly, \(g_{3}\) and \(g_{4}\) must be parallel.

Let \(s\) be the slope of \(g_{1}\) and \(g_{2}\), and let \(t\) be the slope of \(g_{3}\) and \(g_{4}\). To complete the proof, we need to show that all four lines are parallel, that is, \(s=t\), and that this slope value is equal to \(s_{i}\) for some \(i\in[\ell]\).

Without loss of generality, we can assume that \(s\leq t\), otherwise we mirror the gadget along the \(x_{2}\)-axis. Observe that \(s_{1}\leq s\leq t\leq s_{\ell}\) because both \(g_{1}\) and \(g_{2}\) intersect \(I_{3}\), and both \(g_{3}\) and \(g_{4}\) intersect \(I_{4}\).

Let \(i^{*}\coloneqq\max\{i\mid s_{i}\leq s\}\in[\ell]\). If \(i^{*}=\ell\), then \(s=t=s_{\ell}\) and we are done. Otherwise, consider the data point \(\mathbf{q}_{i^{*}}^{+}=\left(\frac{4}{s_{i^{*}+1}-s_{i^{*}}},\frac{2(s_{i^{*} }+s_{i^{*}+1})}{s_{i^{*}+1}-s_{i^{*}}}\right)\), which has label \(y=0\).

Let us have a look at what \(f\) restricted to the vertical line \(h\) through \(\mathbf{q}_{i^{*}}^{+}\) looks like. By \(s\leq t\), the four lines \(g_{1}\), \(g_{2}\), \(g_{3}\), and \(g_{4}\) intersect \(h\) in exactly this order (from bottom to top). This means that these lines do not cross between the \(x_{2}\)-axis and \(h\). By our insights above, this implies that restricted to \(h\), \(f\) is zero outside the intersection points with \(g_{1}\) and \(g_{4}\), increases from zero to one between \(g_{1}\) and \(g_{2}\), stays constant \(1\) between \(g_{2}\) and \(g_{3}\), and decreases back to \(0\) between \(g_{3}\) and \(g_{4}\).

By our choice of \(i^{*}\), we obtain that \(s_{i^{*}+1}>s\). Let us calculate at which \(x_{2}\)-coordinate

Figure 4: Illustration of the segments \(I_{1}\) to \(I_{4}\) used in the proof of Lemma 4. The figure also highlights (in black) the data points at \((0,-2)\) and \((0,2)\), each of which lies on a convex breakline, as well as the data points at \((0,-1)\) and \((0,1)\), each of which lies on a concave breakline.
intersects \(h\). This happens at

\[x_{2}=-2+\frac{4s}{s_{i^{*}+1}-s_{i^{*}}}<-2+\frac{4s_{i^{*}+1}}{s_{i^{*}+1}-s_{i ^{*}}}=\frac{4s_{i^{*}+1}-2(s_{i^{*}+1}-s_{i^{*}})}{s_{i^{*}+1}-s_{i^{*}}}=\frac {2(s_{i^{*}}+s_{i^{*}+1})}{s_{i^{*}+1}-s_{i^{*}}}.\]

Thus, \(\mathbf{q}_{i^{*}}^{+}\) lies strictly above the line \(g_{1}\). Since \(\mathbf{q}_{i^{*}}^{+}\) has label zero, this must imply that \(\mathbf{q}_{i^{*}}^{+}\) does not lie below \(g_{4}\). Looking at the intersection point of \(g_{4}\) with \(h\), this means:

\[2+\frac{4t}{s_{i^{*}+1}-s_{i^{*}}}\leq\frac{2(s_{i^{*}}+s_{i^{*}+ 1})}{s_{i^{*}+1}-s_{i^{*}}}\] \[\Leftrightarrow 2(s_{i^{*}+1}-s_{i^{*}})+4t\leq 2(s_{i^{*}}+s_{i^{*}+1})\] \[\Leftrightarrow t\leq s_{i^{*}}.\]

Thus, we obtain \(s_{i^{*}}\leq s\leq t\leq s_{i^{*}}\), implying that \(g_{1},g_{2},g_{3},g_{4}\) are all parallel and have one of the \(\ell\) predefined slopes. This implies that \(f\) is the levee \(f_{s_{i^{*}}}\), completing the proof of the lemma. 

Combining Multiple Selection Gadgets.Having constructed and understood a single selection gadget, the next step is to use multiple of these gadgets simultaneously. To this end, we will "stack multiple selection gadgets upon each other along the \(x_{2}\)-axis". To make this formal, we define a _selection gadget with offset \(z\)_ as the set of data points of a selection gadget as described above, where we add \(z\) to all \(x_{2}\)-coordinates of the gadget. In other words, the gadget is centered around the point \((0,z)\).

Now, consider the set of data points originating from \(m\) selection gadgets with offsets \(z_{1},\ldots,z_{m}\), each one offering the choice between \(\ell_{j}\) many slopes \(s_{i}^{(j)}\), \(i\in[\ell_{j}]\), \(j\in[m]\). Suppose further that we uniformly choose \(\epsilon\coloneqq\min_{j\in[m]}\min\Bigl{\{}\frac{1}{3|s_{1}^{(j)}|},\frac{1}{ 3|s_{\ell}^{(j)}|}\Bigr{\}}\) for all the gadgets such that the vertical lines \(h_{-\epsilon}\), \(h_{0}\), and \(h_{\epsilon}\) with \(x_{1}\)-coordinates \(-\epsilon\), \(0\), and \(\epsilon\), respectively, each contain either \(9\) or \(13\) data points from each gadget. Let \(\delta\coloneqq\min_{j\in[m]}\min_{i\in[\ell_{j}-1]}(s_{i+1}^{(j)}-s_{i}^{(j)})\) be the smallest difference of two consecutive slopes in the \(m\) gadgets. Moreover, let \(S\coloneqq\max_{j\in[m]}\max_{i\in[\ell_{j}]}|s_{i}^{(j)}|\) be the largest absolute value of all the slopes. In this setting, the following lemma states that fitting all these data points is equivalent to independently choosing one slope for each single gadget and adding up the corresponding levees, provided that the distance of the gadgets is large enough.

**Lemma 5**.: _If \(z_{j+1}-z_{j}\geq\frac{8S}{\delta}+6\) for all \(j\in[m-1]\), then there are exactly \(\prod_{j=1}^{m}\ell_{j}\) many continuous piecewise linear functions \(f\colon\mathbb{R}^{2}\to\mathbb{R}\) with at most \(4m\) breaklines fitting the data points of the \(m\) selection gadgets, namely \(f(x_{1},x_{2})=\sum_{j=1}^{m}f_{s_{i_{j}}^{(j)}}(x_{1},x_{2}-z_{j})\) for each choice of indices \(i_{j}\in[\ell_{j}]\) for each \(j\in[m]\)._

Proof.: We first show that each of these functions does indeed fit all the data points. For this, it is sufficient to show that each levee \(f_{s_{i_{j}}^{(j)}}(x_{1},x_{2}-z_{j})\) is \(0\) at all the data points \((\bar{x}_{1},\bar{x}_{2})\) belonging to a selection gadget with index \(j^{\prime}\neq j\). Without loss of generality, we can assume that \(z_{j}=0\). By the definition of the selection gadget and checking all the possible \(x_{1}\)-coordinates, we obtain that \(|\bar{x}_{1}|\leq\nicefrac{{4}}{{\delta}}\). Moreover, looking at the possible \(x_{2}\)-coordinates, we obtain that \(\bar{x}_{2}\) can differ at most by \(4+S\cdot|\bar{x}_{1}|\) from \(z_{j^{\prime}}\), from which we conclude \(|\bar{x}_{2}|\geq|z_{j^{\prime}}|-4-S\cdot|\bar{x}_{1}|\geq\frac{4S}{\delta}+2\). On the other hand, all points \((x_{1},x_{2})\)
for which the levee \(f_{s_{i_{j}}^{(j)}}(x_{1},x_{2})\) is nonzero satisfy \(|x_{2}|<2+|s_{i_{j}}x_{1}|\leq 2+S|x_{1}|\). Since \(|\bar{x}_{2}|\geq\frac{4S}{\delta}+2\geq 2+S|x_{1}|\), it follows that \(f_{s_{i_{j}}^{(j)}}\) must be zero at \((\bar{x}_{1},\bar{x}_{2})\), completing the proof that all claimed functions fit the \(m\) selection gadgets.

It remains to show that all functions \(f\) fitting the data points of the \(m\) selection gadgets are of the claimed form. We show this by induction on \(m\). The base case \(m=1\) is given by Lemma 4. Now, let \(m\geq 2\) and without loss of generality let \(z_{1}=0\). We will again consider the three vertical lines \(h_{-\epsilon}\), \(h_{0}\), and \(h_{\epsilon}\) with \(x_{1}\)-coordinates \(-\epsilon\), \(0\), and \(\epsilon\), respectively. Remember that \(f\) restricted to each of these three lines is a one-dimensional continuous piecewise linear function with at most \(4m\) breakpoints, stemming from breaklines intersecting the respective vertical line. By looking at each individual gadget and arguing as in the proof of Lemma 4, we obtain the following information:

* There are exactly \(2m\) convex breaklines, intersecting \(h_{0}\) at the \(2m\) points \((0,z_{j}-2)\) and \((0,z_{j}+2)\), \(j\in[m]\). Note that by our assumptions \(z_{1}=0\) and \(z_{j+1}-z_{j}\geq\frac{8S}{\delta}+6>6\), all these points are distinct, two of them are \((0,-2)\) and \((0,2)\), and all the other \(2m-2\) points lie above the horizontal line \(x_{2}=4\).
* There are exactly \(2m\) concave breaklines, intersecting \(h_{0}\) at the \(2m\) points \((0,z_{j}-1)\) and \((0,z_{j}+1)\), \(j\in[m]\). Again by our assumptions \(z_{1}=0\) and \(z_{j+1}-z_{j}\geq\frac{8S}{\delta}+6>6\), all these points are distinct, two of them are \((0,-1)\) and \((0,1)\), and all the other \(2m-2\) points lie above the horizontal line \(x_{2}=5\).
* Each of the four segments \(I_{1}\) to \(I_{4}\) corresponding to the selection gadget with index \(j=1\) as defined in the proof Lemma 4 is intersected by exactly one convex and exactly one concave breakline. There are \(4m-4\) further such segments stemming from selection gadgets with index \(j>1\), and all of those lie completely above the horizontal line \(x_{2}=6-\nicefrac{{7}}{{3}}=\nicefrac{{11}}{{3}}\).

Looking at the breaklines passing through \((0,-2)\) and \((0,-1)\), they must also pass through one of the described \(2m\) segments on \(h_{-\epsilon}\) and one of the described \(2m\) segments on \(h_{\epsilon}\). Since the considered gadget is the lowest one on the \(x_{2}\)-axis, the same argument as in the proof of Lemma 4 applies, which means that the only way of fulfilling these requirements simultaneously is that these breaklines pass through \(I_{1}\) and \(I_{3}\). Once having this, the same argument can be repeated for the breaklines passing through \((0,1)\) and \((0,2)\), making use of the fact that all the \(4m-4\) segments not belonging to the considered gadget lie above the \(x_{2}=\nicefrac{{11}}{{3}}\)-line. Therefore, these breaklines must intersect \(h_{-\epsilon}\) and \(h_{\epsilon}\) within \(I_{2}\) and \(I_{4}\), respectively.

From this, it follows as in the proof of Lemma 4 that the only way to fit the data points of the selection gadget with index \(j=1\) is one of the \(\ell_{1}\) leveses \(f_{s_{i}^{(1)}}\), \(i\in[\ell_{1}]\). Thus, subtracting one of these \(\ell_{1}\) levees from \(f\) eliminates four of the \(4m\) breaklines. Applying induction to the resulting function and the \(m-1\) remaining selection gadgets completes the proof. 

Global Construction.We are now ready to describe the overall reduction. For a given formula \(F=C_{1}\wedge C_{2}\ldots\wedge C_{m}\) with variables \(v_{1},\ldots,v_{n}\), we construct data points in \(\mathbb{R}^{2}\times\mathbb{R}\) such that they can be fitted exactly with \(k=4(m+n)\) ReLUs if and only if \(F\) is a
yes-instance of POITS. Our construction will consist of \(m+n\) selection gadgets, namely one for each clause and one for each variable, and \(3m\) further data points. Each of the \(m\) selection gadgets corresponding to a clause determines which literal of this clause we choose to be true. Each of the \(n\) selection gadgets corresponding to a variable determines whether this variable is true or false. The \(3m\) remaining data points will ensure that these choices are consistent. Let \(\delta\coloneqq\frac{1}{2m}\). This will be the smallest difference of any two consecutive slopes in any selection gadget we are going to use. Moreover, no absolute value of a slope will be larger than \(S\coloneqq 1\). From this, we conclude that, in order to apply Lemma 5 in the end, we need to maintain a distance of at least \(\Delta\coloneqq\frac{8S}{\delta}+6=16m+6\) between the centers of the gadgets.

We start by describing the positions and slopes of the selection gadgets. Compare Figure 5 for an illustration. Firstly, for each clause \(C_{j}\), \(j\in[m]\), we introduce one selection gadget with offset \(j\Delta\) (that is, centered at \((0,j\Delta)\)) and the three different slopes \(s_{1}^{(j)}\coloneqq(2j-2)\delta-1\), \(s_{2}^{(j)}\coloneqq(2j-1)\delta-1\), and \(s_{3}^{(j)}\coloneqq 2j\delta-1\). Note that all these slopes are contained in \([-1,0]\). The interpretation will be as follows: Choosing the levee with slope \(s_{r}^{(j)}\) for the \(j\)-th selection gadget corresponds to choosing the \(r\)-th literal of the \(j\)-th clause as the one that is set to true. Secondly, for each variable \(v_{i}\), \(i\in[n]\), we introduce one selection gadget with offset \(-i\Delta\) and the two slopes \(-1\) and \(1\). Here the interpretation is as follows: choosing the levee with slope \(-1\) corresponds to setting the variable to true, while choosing the levee with slope \(1\) corresponds to setting the variable to false. Finally, if the \(r\)-th literal, \(r\in[3]\), of clause \(C_{j}\) is \(v_{i}\), then we introduce a data point \(\mathbf{p}_{j,r}\) with label \(y=1\) at the intersection of the "center-line" of the levee with slope \(s_{r}^{(j)}\) corresponding to the selection gadget for \(C_{j}\) (that is, the line \(x_{2}=\Delta j+s_{r}^{(j)}x_{1}\)) and the "center-line" of the levee with slope \(1\) corresponding to the selection gadget of \(v_{i}\) (that is, the line \(x_{2}=-\Delta i+x_{1}\)). Thus, \(\mathbf{p}_{j,r}\coloneqq(\frac{\Delta(i+j)}{1-s_{r}^{(j)}},\frac{\Delta(i+j)} {1-s_{r}^{(j)}}-\Delta i)\).

This finishes the construction. Before we prove Theorem 1 using this construction, we show the following useful lemma.

**Lemma 6**.: _For each \(j\in[m]\) and \(r\in[3]\), there are exactly two out of the \(3m+2n\) possible levees defined by the selection gadgets which are non-zero at \(\mathbf{p}_{j,r}\), namely \(f_{s_{r}^{(j)}}(x_{1},x_{2}-j\Delta)\) and \(f_{1}(x_{1},x_{2}+i\Delta)\), where \(v_{i}\) is the \(r\)-th literal in \(C_{j}\)._

Proof.: Since \(\mathbf{p}_{j,r}\) is the intersection point of the center-lines of the two named levees, it suffices to show that no other levee is non-zero at this point.

Let us start by reminding ourselves that a levee with offset \(z\) and slope \(s\) is non-zero only for points within a stripe of "vertical width \(4\)", that is, for points \((x_{1},x_{2})\) with \(sx_{1}+z-2<x_{2}<sx_{1}+z+2\).

Now we focus on levees belonging to other clauses \(C_{j^{\prime}}\) with \(j^{\prime}\neq j\). If \(j^{\prime}>j\), then the slope will be at least \(s_{r}^{(j)}\) and the offset will be at least \((j+1)\Delta\). Since \(\mathbf{p}_{j,r}\) lies on the right-hand side of the \(x_{2}\)-axis and on the center-line of a levee with slope exactly \(s_{r}^{(j)}\) and offset exactly \(j\Delta\), we obtain that \(\mathbf{p}_{j,r}\) lies below the center-line of the considered levee with a vertical distance of at least \(\Delta>2\), implying that the levee must vanish at \(\mathbf{p}_{j,r}\). In the case \(j^{\prime}<j\) it follows similarly with \(\mathbf{p}_{j,r}\) lying above instead of below the considered levee.

Next, let us focus on the two levees belonging to the same clause \(C_{j}\) but to the \(r^{\prime}\)-th literal with \(r^{\prime}\neq r\). The slope of such a levee differs by at least \(\delta\) from \(s_{r}^{(j)}\), while the offset
is exactly \(j\Delta\). This implies that \(\mathbf{p}_{j,r}\) has a vertical distance of at least \(\delta\frac{\Delta(i+j)}{1-s_{r}^{(j)}}\geq\delta\frac{2\Delta}{2}=\delta\Delta >8>2\) from the center-line of the considered levee.

Next, let us focus on a levee with slope 1 belonging to a variable \(v_{i^{\prime}}\) with \(i^{\prime}\neq i\). Since \(\mathbf{p}_{j,r}\) lies on the center-line of the levee with slope 1 belonging to \(v_{i}\), these levees are parallel, and have vertical distance at least \(\Delta>2\), this case is settled, too.

Finally, let us focus on a levee with slope \(-1\) belonging to any variable. Such a levee has an offset of at most \(-\Delta\) and its slope is at most \(s_{r}^{(j)}\). Since \(\mathbf{p}_{j,r}\) lies on the center-line of the levee with offset \(j\Delta\) and slope \(s_{r}^{(j)}\), this implies that its vertical distance to the considered levee is at least \(2\Delta>2\), finishing the proof. 

Finally, we are ready to prove the main theorem.

Proof of Theorem 1.: We reduce from POITS and construct an instance of 2L-ReLU-NN-Train\((\ell)\) with \(k=4(m+n)\) and \(\gamma=0\) as described above. Note that, overall, we introduce \(O(m+n)\) points with rational coordinates (with \(\mathrm{poly}(m,n)\) bits) which are polynomial-time computable.

To prove equivalence between the POITS instance and the constructed instance, let us first assume that the POITS instance is a yes-instance. Let \(T\subseteq[n]\) be a set of indices such that the truth assignment with \(v_{i}=\mathrm{true}\) for \(i\in T\) and \(v_{i}=\mathrm{false}\) for \(i\notin T\) sets exactly one literal per clause to true. Let \(r_{j}\in\{1,2,3\}\) denote which of the three literals is set to true in clause \(C_{j}\) by this assignment. We claim that the following function, which is a sum of \(m+n\) levees and thus realizable with \(k=4(m+n)\) ReLUs using Observation 3,

Figure 5: Global construction layout for the reduction from POITS to 2L-ReLU-NN-Train\((\ell)\). The figure shows the construction for the instance \((v_{5}\lor v_{4}\lor v_{3})\wedge(v_{4}\lor v_{3}\lor v_{2})\wedge(v_{5}\lor v_{ 2}\lor v_{1})\). The vertical dotted line is the \(x_{2}\)-axis along which we place all the selection gadgets. Each gadget is depicted with a black square. Each solid gray line depicts one possible levee. Each gray circle depicts a data point \(\mathbf{p}_{j,r}\) with label one. The picture on the right additionally shows one possible solution to the given instance. Indeed, choosing levees corresponding to the solid black lines selects exactly one levee per selection gadget and exactly one levee passing through each of the nine additional data points. This corresponds to the truth assignment \(v_{1}=v_{3}=\mathrm{true}\) and \(v_{2}=v_{4}=v_{5}=\mathrm{false}\).
exactly fits all the constructed data points:

\[f(x_{1},x_{2})=\sum_{i\in T}f_{-1}(x_{1},x_{2}+i\Delta)+\sum_{i\notin T}f_{1}(x_{ 1},x_{2}+i\Delta)+\sum_{j=1}^{m}f_{s^{(j)}_{r_{j}}}(x_{1},x_{2}-j\Delta). \tag{2}\]

By Lemma 5, \(f\) fits all data points belonging to the selection gadgets. It remains to show that \(f\) attains value \(1\) at all the data points \({\bf p}_{j,r}\), \(j\in[m]\), \(r\in[3]\). To see this, fix such \(j\) and \(r\) and let the \(r\)-th literal in \(C_{j}\) be \(v_{i}\). By Lemma 6, the only two levees which can potentially be non-zero at \({\bf p}_{j,r}\) are \(f_{s^{(j)}}(x_{1},x_{2}-j\Delta)\) and \(f_{1}(x_{1},x_{2}+i\Delta)\). If \(r=r_{j}\), then \(v_{i}=\) true and the former levee attains value \(1\) while the latter levee attains value \(0\) at \({\bf p}_{j,r}\). Otherwise, if \(r\neq r_{j}\), then \(v_{i}=\) false and the former levee attains value \(0\) while the latter levee attains value \(1\) at \({\bf p}_{j,r}\). In both cases, the data point is fitted correctly.

Now suppose conversely that the constructed data points can be precisely fitted with a function \(f\) representable with \(k=4(m+n)\) ReLUs. By Lemma 5, \(f\) must be of the form (2) for some set \(T\subseteq[n]\) and some values \(r_{j}\in[3]\) for all \(j\in[m]\). We claim that setting \(v_{i}=\) true for \(i\in T\) and \(v_{i}=\) false for \(i\notin T\) sets exactly one literal per clause to true. To see this, fix \(j\in[m]\) and \(r\in[3]\) and let \(v_{i}\) be the \(r\)-th literal of \(C_{j}\). Using Lemma 6 again, observe that exactly one of the two levees \(f_{s^{(j)}_{r}}(x_{1},x_{2}-j\Delta)\) and \(f_{1}(x_{1},x_{2}+i\Delta)\) must belong to the sum (2) because the data point \({\bf p}_{j,r}\) has label one. In other words, it holds that either \(r=r_{j}\) (implying \(i\in T\)) or \(i\not\in T\). This implies that, for each \(j\in[m]\), the defined truth assignment sets exactly the \(r_{j}\)-th literal of \(C_{j}\) to true, finishing the overall proof. 

## 4 W[1]-Hardness for Four ReLUs

We show that fixed-parameter tractability with respect to \(d\) is unlikely even for target error zero and four ReLUs. In fact, we prove a running time lower bound of \(n^{\Omega(d)}\) based on the ETH.

**Theorem 7**.: \(2\mathrm{L}\)-ReLU-NN-Train\((\ell)\) _with \(k=4\) and \(\gamma=0\) is W[1]-hard with respect to \(d\) and not solvable in \(\rho(d)n^{o(d)}\operatorname{poly}(L)\) time (where \(L\) is the input bit-length) for any function \(\rho\) assuming the ETH._

We prove Theorem 7 with a parameterized reduction from the \(2\)-Hyperplane Separability problem.

\(2\)-Hyperplane Separability

**Input:**  Two point sets \(Q\) and \(P\) in \(\mathbb{R}^{d}\).

**Question:** Are there two hyperplanes that strictly separate \(Q\) and \(P\)?

Here, two hyperplanes _strictly separate_\(Q\) and \(P\) if, for every pair \(({\bf q},{\bf p})\in Q\times P\), the open line segment \({\bf qp}\) is intersected by at least one hyperplane and no point from \(Q\cup P\) is contained in any of the two hyperplanes. Giannopoulos et al. [12] showed that this problem is W[1]-hard with respect to \(d\) and not solvable in \(\rho(d)m^{o(d)}\operatorname{poly}(L)\) time assuming the ETH (where \(m\coloneqq|Q\cup P|\) and \(L\) is the instance size). In fact, their proof shows that if there is a solution, then there is a solution where \(Q\) lies entirely in one region of the hyperplane arrangement and the points in \(P\) lie only in the two neighboring
regions. Formally, if the two hyperplanes are defined by \(\mathbf{h}_{i}\cdot\mathbf{x}+o_{i}=0\) for \(\mathbf{h}_{i}\in\mathbb{R}^{d}\), \(o_{i}\in\mathbb{R}\), \(i\in[2]\), then (without loss of generality) we can assume that the following holds:

\[\forall\mathbf{q}\in Q:\mathbf{h}_{1}\cdot\mathbf{q}+o_{1}>0> \mathbf{h}_{2}\cdot\mathbf{q}+o_{2} \tag{3}\] \[\forall\mathbf{p}\in P:\operatorname{sgn}(\mathbf{h}_{1}\cdot \mathbf{p}+o_{1})=\operatorname{sgn}(\mathbf{h}_{2}\cdot\mathbf{p}+o_{2}) \tag{4}\]

Moreover, a closer inspection of their reduction shows that one can assume that the hyperplanes have distance at least \(\epsilon\coloneqq m^{-3}\) to each input point2. That is, we can assume

Footnote 2: The critical points in the reduction are the constraint points \(q_{ij}^{uv}\) which are separated from the points \(p_{iu_{i}},p_{\#i},p_{ju_{j}},p_{\#j}\) by some translation of the hyperplane \(H(u_{1},\ldots,u_{k})\) towards the origin. The distance of any \(q_{ij}^{uv}\) to \(H(u_{1},\ldots,u_{k})\) is at least \(2\sin^{3}(\pi/m)\geq 2m^{-3}\) in one dimension.

\[\forall\mathbf{x}\in Q\cup P,i\in[2]:\frac{|\mathbf{h}_{i}\cdot \mathbf{x}+o_{i}|}{\|\mathbf{h}_{i}\|}>\epsilon. \tag{5}\]

We will make use of these assumptions in the following proof.

Proof of Theorem 7.: Let \((Q,P)\) be an instance of (restricted) \(2\)-Hyperplane Separability and let \(m\coloneqq|Q\cup P|\) and \(\epsilon\coloneqq m^{-3}\). We construct the instance \((X\subseteq\mathbb{R}^{d+1},k\coloneqq 4,\gamma\coloneqq 0)\) of \(2\)L-ReLU-NN-Train\((\ell)\), where \(X\) contains the following points:

* \((\mathbf{q},1)\) for each \(\mathbf{q}\in Q\),
* \((\mathbf{p},0)\) for each \(\mathbf{p}\in P\),
* \((\mathbf{r}_{\mathbf{qp}}\coloneqq(1-\delta)\mathbf{q}+\delta\mathbf{p},1)\) and \((\mathbf{s}_{\mathbf{qp}}\coloneqq\delta\mathbf{q}+(1-\delta)\mathbf{p},0)\) for each \((\mathbf{q},\mathbf{p})\in Q\times P\), where \(\delta\coloneqq\epsilon(2\|\mathbf{q}-\mathbf{p}\|)^{-1}\).

Note that \(\mathbf{r}_{\mathbf{qp}}\) (\(\mathbf{s}_{\mathbf{qp}}\)) lies on the line segment \(\mathbf{qp}\) at distance \(\nicefrac{{\epsilon}}{{2}}\) to \(\mathbf{q}\) (\(\mathbf{p}\)). Overall, we construct \(n\coloneqq|X|\in O(m^{2})\) points, which can be done in polynomial time.

For the correctness, assume first that there are two hyperplanes \(\mathcal{H}_{i}\), \(i\in[2]\), defined by \(\mathbf{h}_{i}\cdot\mathbf{x}+o_{i}=0\) (wlog \(\|\mathbf{h}_{i}\|=1\)) that strictly separate \(Q\) and \(P\) and satisfy (3)-(5).

A solution for \((X,4,0)\) can then be constructed as follows (see also Figure 6): We use two ReLUs realizing an "upward step" of height \(1\) (with slope \(\beta\coloneqq\nicefrac{{4}}{{\epsilon}}\)) in the direction of \(\mathbf{h}_{1}\). That is, we set

\[\mathbf{w}_{1} \coloneqq\beta\mathbf{h}_{1}, b_{1} \coloneqq\beta o_{1}, a_{1} \coloneqq 1,\] \[\mathbf{w}_{2} \coloneqq\beta\mathbf{h}_{1}, b_{2} \coloneqq\beta o_{1}-1, a_{2} \coloneqq-1.\]

Additionally, we use two ReLUs realizing a "downward step" of height \(1\) (with slope \(-\beta\)) in the direction of \(\mathbf{h}_{2}\), that is,

\[\mathbf{w}_{3} \coloneqq\beta\mathbf{h}_{2}, b_{3} \coloneqq\beta o_{2}, a_{3} \coloneqq-1,\] \[\mathbf{w}_{4} \coloneqq\beta\mathbf{h}_{2}, b_{4} \coloneqq\beta o_{2}-1, a_{4} \coloneqq 1.\]

Let \(\mathcal{W}_{i}\) be the hyperplane defined by \(\mathbf{w}_{i}\cdot\mathbf{x}+b_{i}=0\) for \(i\in[4]\). Note that \(\mathcal{W}_{1}=\mathcal{H}_{1}\) and \(\mathcal{W}_{3}=\mathcal{H}_{2}\). Note further that \(\mathcal{W}_{2}\) is parallel to \(\mathcal{W}_{1}\) at distance \(\beta^{-1}=\nicefrac{{\epsilon}}{{4}}\) and \(\mathcal{W}_{4}\) is parallel to \(\mathcal{W}_{3}\) at distance \(\nicefrac{{\epsilon}}{{4}}\).
To verify that all data points are exactly fitted, consider first a point \(\mathbf{q}\in Q\). From (3) and (5), we obtain

\[\mathbf{w_{1}}\cdot\mathbf{q}+b_{1} =\beta(\mathbf{h}_{1}\cdot\mathbf{q}+o_{1})>0,\] \[\mathbf{w_{2}}\cdot\mathbf{q}+b_{2} =\beta(\mathbf{h}_{1}\cdot\mathbf{q}+o_{1}-\beta^{-1})>\beta \epsilon-1>0,\] \[\mathbf{w_{3}}\cdot\mathbf{q}+b_{3} =\beta(\mathbf{h}_{2}\cdot\mathbf{q}+o_{2})<0,\] \[\mathbf{w_{4}}\cdot\mathbf{q}+b_{4} =\beta(\mathbf{h}_{2}\cdot\mathbf{q}+o_{2}-\beta^{-1})<0.\]

From the above inequalities, it follows

\[\phi(\mathbf{q})=\beta(\mathbf{h}_{1}\cdot\mathbf{q}+o_{1})-\beta(\mathbf{h}_ {1}\cdot\mathbf{q}+o_{1}-\beta^{-1})=1.\]

Now consider a point \(\mathbf{r_{qp}}\) and note that, for each \(\mathcal{W}_{i}\), \(\mathbf{r_{qp}}\) lies in the same half-space as \(\mathbf{q}\) since it has distance \(\nicefrac{{\epsilon}}{{2}}\) to \(\mathbf{q}\) which has distance at least \(\frac{3}{4}\epsilon\) to \(\mathcal{W}_{i}\) (by (5)). Thus,

\[\phi(\mathbf{r_{qp}})=\beta(\mathbf{h}_{1}\cdot\mathbf{r_{qp}}+o_{1})-\beta( \mathbf{h}_{1}\cdot\mathbf{r_{qp}}+o_{1}-\beta^{-1})=1.\]

Next, consider a point \(\mathbf{p}\in P\). Using (4) and (5), one easily verifies that

\[\operatorname{sgn}(\mathbf{w_{1}}\cdot\mathbf{p}+b_{1})=\operatorname{sgn}( \mathbf{w_{2}}\cdot\mathbf{p}+b_{2})=\operatorname{sgn}(\mathbf{w_{3}}\cdot \mathbf{p}+b_{3})=\operatorname{sgn}(\mathbf{w_{4}}\cdot\mathbf{p}+b_{4}).\]

Hence, \(\phi(\mathbf{p})=0\) clearly holds if all the above signs are negative. If all signs are positive, then

\[\phi(\mathbf{p})=\beta(\mathbf{h}_{1}\cdot\mathbf{p}+o_{1})-\beta(\mathbf{h}_ {1}\cdot\mathbf{p}+o_{1}-\beta^{-1})-\beta(\mathbf{h}_{2}\cdot\mathbf{p}+o_{2 })+\beta(\mathbf{h}_{2}\cdot\mathbf{p}+o_{2}-\beta^{-1})=0.\]

Finally, any point \(\mathbf{s_{qp}}\) analogously lies in the same half-space as \(\mathbf{p}\) for each \(\mathcal{W}_{i}\), which also implies \(\phi(\mathbf{s_{qp}})=0\). Thus, all points are correctly fitted.

Conversely, assume that the points in \(X\) can be exactly fitted by \(\phi\) realized by four ReLUs with values \(\mathbf{w}_{i},b_{i},a_{i}\), \(i\in[4]\). Let \(I^{+}\coloneqq\{i\in[4]\mid a_{i}=1\}\) and \(I^{-}\coloneqq\{i\in[4]\mid a_{i}=-1\}\).

Consider an arbitrary line segment \(\mathbf{qp}\) for \((\mathbf{q},\mathbf{p})\in Q\times P\). Clearly, the points \((\mathbf{q},1)\), \((\mathbf{r_{qp}},1)\) and \((\mathbf{s_{qp}},0)\) on this line segment cannot all lie on the same piece of \(\phi\). Hence, \(\phi\) must have a concave breakpoint at some point on the open segment between \(\mathbf{q}\) and \(\mathbf{p}\). That is, there must be a ReLU \(i\in I^{-}\) such that the hyperplane defined by \((\mathbf{w}_{i},b_{i})\) intersects the open line segment \(\mathbf{qp}\) and does not contain \(\mathbf{q}\) or \(\mathbf{p}\). Analogously, the points \((\mathbf{p},0)\), \((\mathbf{s_{qp}},0)\) and \((\mathbf{r_{qp}},1)\) enforce a convex breakpoint, that is, a ReLU \(j\in I^{+}\) with a hyperplane \((\mathbf{w}_{j},b_{j})\) also intersecting the open line segment \(\mathbf{qp}\) and not containing \(\mathbf{q}\) or \(\mathbf{p}\).

To sum up, every open line segment \(\mathbf{qp}\) is intersected by at least two hyperplanes (not containing \(\mathbf{q}\) or \(\mathbf{p}\)), one corresponding to a ReLU \(i\in I^{-1}\) and one corresponding to a ReLU \(j\in I^{+}\). Since there are only four ReLUs, it follows that \(\min(|I^{+}|,|I^{-}|)\leq 2\). That is, we obtain a solution for \(2\)-Hyperplane Separability by picking either all hyperplanes corresponding to \(I^{+}\) or all hyperplanes corresponding to \(I^{-}\).

This finishes the reduction. Note that since the dimension of the input data points in our constructed instance is \(d\), any algorithm solving \(2\)L-ReLU-NN-Train\((\ell)\) in time \(\rho(d)n^{o(d)}\operatorname{poly}(L)\) would imply an algorithm running in time \(\rho(d)m^{o(d)}\operatorname{poly}(L^{\prime})\) for \(2\)-Hyperplane Separability contradicting the ETH.
## 5 Hardness Results for Linear Threshold Activations

A nowadays less popular, but more classical activation function than ReLU is the linear threshold function \(x\mapsto\mathds{1}_{\{x>0\}}\). Analogously to 2L-ReLU-NN-Train\((\ell)\), we consider the following decision version of the training problem for linear threshold functions:

\begin{tabular}{l l}
2L-LT-NN-Train\((\ell)\) \\
**Input:** & Data points \((\mathbf{x}_{1},y_{1}),\ldots,(\mathbf{x}_{n},y_{n})\in\mathbb{R}^{d}\times \mathbb{R}\), a number \(k\in\mathbb{N}\) of linear \\  & threshold neurons, and a target error \(\gamma\in\mathbb{R}_{\geq 0}\). \\
**Question:** & Are there weights \(\mathbf{w}_{1},\ldots,\mathbf{w}_{k}\in\mathbb{R}^{d}\), biases \(b_{1},\ldots,b_{k}\in\mathbb{R}\), and coefficients \(a_{1},\ldots,a_{k}\in\mathbb{R}\) such that \\  & \\ \end{tabular}

Note that for linear thresholds, we cannot assume \(a_{j}\in\{-1,1\}\) because the normalization used in the ReLU case does not apply here.

As in the ReLU case, the crucial ingredient to study the training complexity of linear threshold networks is their geometry. To this end, observe that every function represented by a 2-layer linear threshold network is piecewise constant, where the pieces emerge from the hyperplane arrangement defined by the \(k\) hyperplanes \(\mathbf{w}_{j}\cdot\mathbf{x}+b_{j}=0\), \(j\in[k]\), corresponding to the hidden neurons. Since our reductions for the ReLU case always use two ReLUs to approximate "step functions" from 0 to 1 and from 1 to 0, it is easy to adapt the reductions to the linear threshold case.

**Corollary 8**.: \(2\)_L-LT-NN-Train\((\ell)\) is NP-hard even for \(d=2\) and \(\gamma=0\)._

Figure 6: Example of the reduction from \(2\)-Hyperplane Separability for \(d=2\) dimensions. Big points are points in \(Q\) (dark gray) and in \(P\) (light gray). The small points are additionally introduced. The four lines are the breaklines of the four ReLUs. The two thick lines indicate the original two separating lines. The dashed circle has radius \(\epsilon\).
Proof.: We use an analogous reduction to the proof of Theorem 1. Instead of a sum of levees, we use a sum of "stripes" within which the function attains value \(1\). With this idea, it is straight-forward to build selection gadgets and an analogous global construction. Note that the number \(k\) of required linear threshold neurons is only \(k=2(m+n)\) for a POITS instance with \(m\) clauses and \(n\) variables because each stripe can be realized with two linear threshold neurons instead of the four ReLUs required to build a levee. 

For the sake of completeness, we note that also the W[1]-hardness result by Froese et al. [10] extends to linear threshold functions. To this end, consider the \(\ell^{p}\)-loss \(\ell(\hat{y},y)=|\hat{y}-y|^{p}\), with \(\ell^{0}\) simply counting the non-zero components of \(\hat{y}-y\).

**Corollary 9**.: _For each \(p\in[0,\infty[\), \(2\)L-LT-NN-Train\((\ell^{p})\) with \(k=1\) is NP-hard, W[1]-hard with respect to \(d\) and not solvable in \(\rho(d)n^{o(d)}\operatorname{poly}(L)\) time (where \(L\) is the input bit-length) for any function \(\rho\) assuming the ETH._

Proof.: Having a careful look into the reduction from Multicolored Clique by Froese et al. [10], it turns out that the single ReLU neuron used in this reduction can be replaced by a linear threshold neuron without changing the logic of the reduction. 

Finally, also Theorem 7 finds its analogue for the linear threshold case.

**Corollary 10**.: \(2\)L-LT-NN-Train\((\ell)\) _with \(k=2\) and \(\gamma=0\) is W[1]-hard with respect to \(d\) and not solvable in \(\rho(d)n^{o(d)}\operatorname{poly}(L)\) time (where \(L\) is the input bit-length) for any function \(\rho\) assuming the ETH._

Proof.: The proof is analogous to (even much easier than) the one of Theorem 7. Instead of two ReLUs to realize a step of height one, we can simply use one linear threshold neuron (which is why we obtain hardness already for \(k=2\) in this case). Note that we do not even need to introduce the additional data points \(\mathbf{r_{qp}}\) and \(\mathbf{s_{qp}}\) and obtain a much more direct reduction from \(2\)-Hyperplane Separability. 

## 6 An Algorithm for Exact Fitting in the Convex Case

Contrasting the previous two hardness results, we now consider the tractable special case where all coefficients \(a_{j}\) are \(1\). In this case, the neural network realizes a convex continuous piecewise linear function \(\phi(\mathbf{x})=\sum_{j=1}^{k}[\mathbf{w}_{j}\cdot\mathbf{x}+b_{j}]_{+}\) with at most \(2^{k}\) distinct (affine) pieces. We show that this case (which we call \(2\)L-ReLU-NN-Train\((\ell)^{+}\)) with target error \(\gamma=0\) is FPT for the parameter \(d+k\).

**Theorem 11**.: \(2\)L-ReLU-NN-Train\((\ell)^{+}\) _can be solved in \(2^{O(k^{2}d)}\operatorname{poly}(k,L)\) time for \(\gamma=0\), where \(L\) is the input bit-length._

Before giving the proof, we introduce some definitions. For \(I\subseteq[k]\), let \(R_{I}\subseteq\mathbb{R}^{d}\) be the _active region_ of the ReLUs in \(I\), that is, \(\mathbf{x}\in R_{I}\) if and only if

\[\forall j\in I:\mathbf{w}_{j}\mathbf{x}+b_{j} \geq 0,\] \[\forall j\in[k]\setminus I:\mathbf{w}_{j}\mathbf{x}+b_{j} \leq 0.\]
Note that \(R_{I}\) could be empty. Clearly, on each \(R_{I}\), \(\phi\) is the affine function \(\sum_{j\in I}(\mathbf{w}_{j}\cdot\mathbf{x}+b_{j})\). Let \(F_{I}\coloneqq\{(\mathbf{x},\phi(\mathbf{x}))\mid\mathbf{x}\in R_{I}\}\}\) be the piece corresponding to \(I\).

The convexity of \(\phi\) now allows for a branching algorithm assigning the input data points to the at most \(2^{k}\) pieces.

Proof of Theorem 11.: Let \((\mathbf{x}_{1},y_{1}),\ldots,(\mathbf{x}_{n},y_{n})\in\mathbb{R}^{d+1}\), \(k\in\mathbb{N}\), and let \(L\) denote the overall number of input bits. The idea is to use a search tree algorithm to check whether the data can be exactly fitted with \(k\) (convex) ReLUs. To this end, we define \(2^{k}\) sets \(S_{1},\ldots,S_{2^{k}}\) where each \(i\in[2^{k}]\) one-to-one corresponds to a certain subset \(I(i)\subseteq[k]\) of active ReLUs. For given point sets \(S\subseteq\mathbb{R}^{d+1}\) and \(S_{i}\subseteq\mathbb{R}^{d+1}\), \(i\in[2^{k}]\), our algorithm checks whether the points in \(S\) can be exactly fitted by \(k\) ReLUs with the additional constraint that \(S_{i}\subseteq F_{I(i)}\) holds for each \(i\in[2^{k}]\). That is, the following (in)equalities must hold

\[\mathbf{x}\in R_{I(i)}\text{ and }\sum_{j\in I(i)}\mathbf{w}_{j}\mathbf{x}+b_{ j}=y,\quad i\in[2^{k}],(\mathbf{x},y)\in S_{i}. \tag{6}\]

Algorithm 1 depicts the pseudocode of our ExactFit algorithm. We solve an instance with an initial call where \(S\coloneqq\{(\mathbf{x}_{1},y_{1}),\ldots,(\mathbf{x}_{n},y_{n})\},S_{1}=S_{2 }=\cdots=S_{2^{k}}\coloneqq\emptyset\).

The correctness of Algorithm 1 follows by induction on \(|S|\). For \(S=\emptyset\), we simply need to check whether the system (6) of linear (in)equalities is feasible. This can be done by solving a linear program with \(k(d+1)\) variables and \(O(n)\) constraints in \(O(\operatorname{poly}(k,L))\) time (this is done by check-feasibility in Line 2).

If \(S\neq\emptyset\) and \((S,S_{1},\ldots,S_{2^{k}})\) is a no-instance, then none of the recursive calls in Line 9 will be successful (by induction). Hence, the algorithm correctly returns "No" in Line 11.

Now assume that \((S,S_{1},\ldots,S_{2^{k}})\) is a yes-instance. Then, any point \((\mathbf{x},y)\in S\) must lie on some piece \(F_{I(i)}\). That is, \((\mathbf{x},y)\) can be put into some \(S_{i}\). Hence, in Line 6, we branch into all \(2^{k}\) options. In each branch, we then check whether putting \((\mathbf{x},y)\) into \(S_{i}\) also forces other points from \(S\) (due to assumed convexity) to be contained in some \(S_{i^{\prime}}\) (this is done by check-forced-points in Line 8). We do this in order to achieve our claimed running time bound as we will show later.

The pseudocode for this check is given in Algorithm 2. The idea is to compute for
each \((\mathbf{x},y)\in S\) and each \(i\in[2^{k}]\) the lower bound

\[\mu\coloneqq\min_{\mathbf{w}_{j},b_{j}}\sum_{j\in I(i)}(\mathbf{w}_{j}\mathbf{x} +b_{j})\]

subject to the constraints (6), which again can be accomplished via linear programming in \(O(\operatorname{poly}(k,L))\) time. Note that both \(\mu=+\infty\) (linear program is infeasible) and \(\mu=-\infty\) (linear program is unbounded) are possible. This is done by lower-bound in Line 3. Now, note that \(\mu>y\) implies that

\[\phi(\mathbf{x})=\sum_{j=1}^{k}[\mathbf{w}_{j}\mathbf{x}+b_{j}]_{+}\geq\sum_{ j\in I(i)}(\mathbf{w}_{j}\mathbf{x}+b_{j})>y\]

holds for every \(\phi\) satisfying (6). That is, we can reject (Line 9) the current branch of ExactFit. If \(\mu=y\), then we have

\[\phi(\mathbf{x})\geq\sum_{j\in I(i)}(\mathbf{w}_{j}\mathbf{x}+b_{j})=y\]

for every \(\phi\) satisfying (6), and thus we can safely put \((\mathbf{x},y)\) into \(S_{i}\). To see that this is correct, assume that a solution puts \((\mathbf{x},y)\in F_{I^{\prime}}\) for some \(I^{\prime}\subseteq[k]\) with \(I^{\prime}\neq I(i)\). Then, we have

\[y =\sum_{j\in I^{\prime}}(\mathbf{w}_{j}\mathbf{x}+b_{j})=\sum_{j \in I^{\prime}\cap I(i)}(\mathbf{w}_{j}\mathbf{x}+b_{j})+\sum_{j\in I^{\prime }\setminus I(i)}(\mathbf{w}_{j}\mathbf{x}+b_{j})\] \[=\sum_{j\in I(i)}(\mathbf{w}_{j}\mathbf{x}+b_{j})=\sum_{j\in I^{ \prime}\cap I(i)}(\mathbf{w}_{j}\mathbf{x}+b_{j})+\sum_{j\in I(i)\setminus I^ {\prime}}(\mathbf{w}_{j}\mathbf{x}+b_{j}),\]

which implies

\[\sum_{j\in I^{\prime}\setminus I(i)}(\mathbf{w}_{j}\mathbf{x}+b_{j})=\sum_{j \in I(i)\setminus I^{\prime}}(\mathbf{w}_{j}\mathbf{x}+b_{j}).\]

Since \(\mathbf{x}\in R_{I^{\prime}}\), it follows that the left sum is at least zero and the right sum is at most zero. Thus, both sums are zero and \(\mathbf{w}_{j}\mathbf{x}+b_{j}=0\) holds for all \(j\in(I^{\prime}\setminus I(i))\cup(I(i)\setminus I^{\prime})\), which shows that \(\mathbf{x}\in R_{I(i)}\). Thus, putting \((\mathbf{x},y)\) into \(S_{i}\) is correct.

Note that adding a point to \(S_{i}\) adds new constraints to (6). Hence, we restart the procedure (Line 7) to check whether this forces new points. Overall, check-forced-points takes \(O(n^{2}2^{k}\operatorname{poly}(k,L))\subseteq O(2^{k}\operatorname{poly}(k,L))\) time.
As regards the correctness of Algorithm 1 now, note that check-forced-points clearly never incorrectly rejects a branch of ExactFit and never forces points incorrectly. Hence, one of the recursive calls in Line 9 will correctly answer "Yes" (by induction), which proves the correctness.

It remains to analyze the running time of Algorithm 1. Clearly, each call to the algorithm takes \(O(2^{k}\operatorname{poly}(k,L))\) time and recursively branches into \(2^{k}\) options. It remains to bound the depth of the recursion tree. To this end, note that the recursion stops as soon as \(S\) is empty or the current branch is rejected by Algorithm 2. We claim that the latter happens after at most \(k(d+1)+1\) recursive calls.

To verify this claim, observe that the algorithm maintains the invariant that the linear program

\[\min_{\mathbf{w}_{j},b_{j}}\sum_{j\in I(i)}(\mathbf{w}_{j}\mathbf{x}+b_{j}) \quad\text{s.t. }\eqref{eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursioneq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursioneq:recursion_eq:recursioneq:recursion_eq:recursioneq:recursion_eq:recursion_eq:rec:ursion_eq:recursion_eq:recursion_eq:recursioneq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:recursioneq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:rec:ursion_eq:recursion_eq:recursioneq:rec:ursion_eq:recursion_eq:recursion_eq:recursioneq:recursion_eq:recursion_eq:rec:ursion_eq:recursion_eq:recursioneq:recursion_eq:recursion_eq:recursion_eq:recursioneq:recursion_eq:recursion_eq:rec:ursion_eq:recursion_eq:receq:recursion_eq:recursion_eq:recursion_eq:recursion_eq:receq:recursioneq:receq:recursion_eq:receq:recursion_eq:receq:receq:ursion_eq:recursion_eq
In a broader context, open directions are to further study the computational complexity in appropriate approximate settings, draw further conclusions on generalization, and understand deeper network architectures.
