MLP
How it works
Forward pass: the input data flows sequentially through the layers; each layer computes a weighted sum (a matrix multiply of the weights with the input vector) plus a bias, then applies an activation function. Loss computation: the network output is compared with the target using a loss function. Backpropagation: gradients of the loss with respect to all weights are computed from the output layer back to the input layer using the chain rule. Weight update: an optimizer (e.g. SGD, Adam) adjusts the weights in the direction of the descending gradient. The cycle repeats over successive batches of data until convergence.
Problem solved
The single Rosenblatt perceptron could only separate linearly separable classes and failed on simple problems such as XOR. The MLP solves this by adding hidden layers with nonlinear activations, allowing it to model complex, nonlinear relationships. What was missing was an effective way to train such networks โ backpropagation provided it, enabling efficient end-to-end training of multilayer networks.
Components
Accepts the input feature vector; the number of neurons matches the dimensionality of the input data.
A dense layer computing a weighted sum of inputs plus a bias; parameterized by a weight matrix. An MLP has one or more such layers.
A nonlinearity applied after the linear transformation (sigmoid, tanh, ReLU and variants); without it the network would collapse to a single linear transformation.
Official
The final layer producing the prediction; its activation depends on the task (softmax for multiclass classification, linear for regression).
Implementation
Deep MLPs with saturating activations (sigmoid, tanh) lose the gradient signal, which stalls training.
The large parameter count of fully connected layers easily fits noise in the training data.
The MLP ignores the spatial or temporal structure of the data (images, sequences) and requires a huge number of parameters.
Unstandardized input features slow down or destabilize gradient-based training.
Evolution
Frank Rosenblatt introduces the perceptron โ a single-layer linear classifier, the precursor of the MLP.
The book "Perceptrons" shows that a single perceptron cannot solve XOR โ contributing to the first AI winter.
Rumelhart, Hinton and Williams popularize backpropagation, making practical training of MLPs possible.
Cybenko (1989), followed by Hornik (1991), prove that an MLP with a single hidden layer can approximate any continuous function.
The ReLU activation (Glorot et al., 2011) mitigates the vanishing-gradient problem and eases training of deep networks.
An all-MLP architecture (Tolstikhin et al.) achieves competitive results in computer vision, renewing interest in fully connected layers.
Hyperparameters (configurable axes)
Number of hidden layers; greater depth increases representational capacity but makes training harder (vanishing gradients).
Number of neurons in a hidden layer; affects model capacity and, quadratically, the parameter count.
The choice of nonlinearity (ReLU, GELU, tanh, sigmoid) affects training dynamics and gradient flow.
Computational complexity
Time complexity: O(ฮฃโ nโโโยทnโ). Space complexity: O(ฮฃโ nโโโยทnโ).
Compute bottleneck
The dominant cost is the dense weight-matrix multiplications; parameter count and compute grow quadratically with layer width.
Execution paradigm
All neurons and all connections are active for every input โ there is no conditional routing or sparse activation.
Parallelism
Computation within a layer (matrix multiply) and across samples in a batch is fully parallel, but layers must be computed sequentially (the output of one is the input of the next).
Hardware requirements
Dense matrix multiplications map ideally onto GPU tensor cores.
TPUs are optimized for the matrix operations typical of dense layers.
Smaller MLPs run efficiently on CPUs with AVX vector instructions.