Four-input parity network 2026-10-14
Let be the number of active inputs. Four hidden units , , detect successively larger counts. A binary threshold unit with weights on these features and threshold returns one precisely for . Each hidden input weight is one. This computes parity with a single hidden layer, but representability does not guarantee easy learning by backpropagation.
Hidden unit 2026-10-14
A hidden unit transforms input information before the final output rather than directly representing a supplied target. Nonlinear hidden features can make a classification linearly separable in feature space even when it is not separable in the original input coordinates.
Apply the chain rule to the squared loss, using the same pre-update weights throughout a forward and backward pass. At the output, and . Therefore
For a gradient descent step of size , define . This gives .
A hidden activation affects all output units to which it connects. Thus
and
The learning rate is already contained in and hence in ; do not multiply by it a second time. For a sigmoid function, . Thresholds can be treated as negative biases with an extra constant input and updated by the same derivative rule.
This is squared-error backpropagation. The forward pass computes activations, while the backward pass transports output-loss derivatives through the outgoing weights and the derivatives of the activation functions, yielding an error signal for every hidden unit. That reverse flow of derivatives explains the name backpropagation.
Nonlinear hidden units create useful intermediate features, allowing the output to combine features rather than classify the original inputs directly. For example, two binary threshold units can compute OR and AND of two binary inputs; thresholding OR minus twice AND at gives XOR. A single monotone threshold of an affine function of the original two inputs cannot implement XOR: the two positive examples lie opposite each other and cannot be separated from the two negative examples by one line. Hidden features can also detect edges or other local patterns before a subsequent layer combines them into object-level features.
If hidden activation functions are identities, substitute into the output input to obtain
With biases included this is still one affine map. Linear hidden layers collapse into a single effective layer and add no nonlinear feature-building ability. The output may remain nonlinear, but its preactivation is just an affine function of the inputs. With standard monotone output activations this still cannot solve XOR or parity by one output unit. An artificially chosen nonmonotone output function could itself encode a complicated scalar decision rule, but that would not be a benefit of the linear hidden layer.
Use the four-input parity network. Let . Four hidden units each receive all inputs with weight one and have thresholds . Thus
where for and zero otherwise. The output receives weights and has threshold :
The computation depends only on input count, so the following table checks all sixteen patterns at once:
The output is one exactly for an odd input count. The hidden features detect nested count thresholds, whose alternating sum extracts odd parity.
This representation does not make learning automatically easy. Hard binary threshold units have no usable ordinary derivative; backpropagation normally uses smooth approximations. With uniformly sampled parity patterns, each individual input has zero correlation with the target, so simple first-order features provide no direct cue to the required interaction. The desired output also flips between neighboring count classes. A smooth network has sufficient capacity, but its training can be sensitive to initialization, saturation and local optimization; representability and trainability are different issues.