Training a 3-node neural network is NP-complete: NP-completeness of exact training on Boolean inputsResearch Paper
Why exact training can be computationally difficult
Training a classifier asks for parameters that fit observed examples. Even when the data can be classified perfectly, the task of finding suitable parameters can have substantial computational cost. The question here concerns exact training: deciding whether any parameter choice makes zero mistakes on the entire supplied data set. It concerns computation on given data, rather than the number of examples needed to predict unseen observations.
Blum and Rivest study a particularly small threshold network: two hidden nodes followed by one output node. The number of computational nodes stays fixed at three, while the number of input coordinates varies. Their headline theorem says that exact training of this architecture is NP-complete even when every input coordinate is Boolean (Blum and Rivest, 1992, §§1–3). The mission formalizes that theorem and its positive-quadrant prerequisite from the published paper.
The network and its training data
A linear threshold node takes real inputs , multiplies them by real weights , and compares their sum with a real threshold . Its output is
In particular, equality produces the negative output. The network has two such hidden nodes , each receiving every coordinate of . Its output is
The output node receives numerical values −1 and +1. All hidden weights, both hidden thresholds, both output weights and the output threshold can be chosen independently as arbitrary real numbers. There are no further nodes or connections. This is the topology in Figure 1 and the threshold convention of §2 (source, p. 119).
A training instance consists of a dimension and finitely many examples , where and . It is trainable when some network parameter choice satisfies on every example. The question includes data that cannot be fitted. It imposes no distribution on the examples and no tolerance for misclassification.
Formalization targets
Let be the language of explicitly encoded trainable instances. One language includes all input dimensions and all finite training sets. The goal is Theorem 1, printed p. 119:
Here NP-completeness includes both a polynomially checkable finite certificate for every yes-instance and polynomial-time many-one reductions from every problem in NP. The existence of a certificate is part of the conclusion; real network parameters remain unrestricted in the definition of a yes-instance.
The single milestone is Theorem 2, printed p. 120. A positive quadrant is an intersection of two real threshold regions that contains all positive examples and none of the negative examples. Write for its feasibility language restricted to at most example rows. The milestone is
The constant is chosen once for the entire language. This expresses the unspecified example bound in the problem definition of §3.1. Both targets retain the full NP-completeness conclusions of the paper (source, Theorems 1–2).
What the result establishes
The headline result locates a worst-case computational obstruction in an architecture with only three threshold nodes. Under , an algorithm cannot decide exact trainability on every such finite Boolean data set in polynomial time. The result does not say that every training instance is hard, nor does it assert an exponential lower bound. It separates a general guarantee on exact training from the performance a method might achieve on particular data (source, §§1 and 7).
The formal development supplies a concrete interface between real-valued network feasibility and finite-string computational complexity. The reusable threshold node, explicit network evaluation and input language make the numerical conventions visible. The present items are checked declarations of the paper's targets; their proofs remain to be supplied. Completing them requires establishing both the certificate and hardness components under the same definitions.
Why the formal proof requires care
Labels constrain only the final output. They do not specify the outputs of the hidden nodes. Consequently, choosing the hidden classifications is part of the training problem. In addition, the output node is itself trainable: a difficulty result for the fixed-AND auxiliary model does not by itself establish difficulty for the full model, whose feasible class is larger (source, §§3.1–3.3).
There is also a distinction between real parameters and finite witnesses. Merely existentially quantifying real weights does not give an NP verifier. The proof must connect feasibility to finite certificates and account for their bit lengths. Finally, the linear example bound in the quadrant problem has to hold with a constant independent of each instance. These obligations remain in the targets rather than becoming assumed hypotheses.
Formalization scope and conventions
Coordinates use Fin n; labels use Bool, with true denoting +1. A separate conversion interprets Boolean input coordinates as 0 or 1, so the two numerical roles cannot be confused. Training examples form finite lists. Listing each source pair once represents a finite training set; reordering or repeating an identical pair does not affect exact agreement. Conflicting labels on one input are infeasible. Empty data and zero-dimensional inputs are included.
The alphabet has five symbols. An instance starts with dimension ticks and a header terminator, followed by explicit rows. Each row contains coordinate bits, a label bit and a row terminator. For rows the length is , linear in the explicit dimension-and-row representation. Empty data have only their dimension header. A string outside the encoder's range is rejected. The quadrant budget counts listed rows; at dimension zero its budget permits only empty data.
The two quadrant cuts may be parallel, coincident or constant. Choosing their orientations and perturbing thresholds on a finite sample expresses the selected quadrant using strict positive regions; no margin or general-position assumption is imposed. The full training goal keeps all three nodes trainable and includes no weight bounds or assumed reduction.
The development imports the published CookPvsNP_defs model of Turing machines, polynomial time, finite witnesses and many-one reductions. Thresholds form their own definition module, and the paper-specific network builds on them. Contributions to finite-certificate theory and complexity reductions can use these interfaces. Independent Theorems 3–8 concern different networks or approximation questions and are outside this mission's dependency scope.
Selected references
- A. L. Blum and R. L. Rivest, Training a 3-Node Neural Network is NP-Complete, Neural Networks 5 (1992), 117–127. Published article. All numbering and pagination in this mission refer to this version.