Multi-Layer Perceptron (MLP)
A multi-layer perceptron (MLP) is a feedforward neural network formed by stacking several fully connected layers with nonlinear activation functions between them. It extends the linear discriminative power of the single-layer perceptron into a universal approximator able to approximate any continuous function, and it is the skeleton structure of deep learning as well as a basic module that recurs in complex architectures such as Transformers and convolutional networks.
Core Principles
The structure of an MLP can be summarized as "input layer, several hidden layers, output layer". Each layer does two things: first a linear transformation of the previous layer's output, h = Wx + b, then an elementwise nonlinear activation function sigma, producing a new representation. The overall function after stacking several layers is sigma(W3 sigma(W2 sigma(W1 x + b1) + b2) + b3), and representational power grows exponentially with depth rather than as a simple linear addition.
The universal approximation theorem proved by Hornik and others in 1989 is the theoretical cornerstone of the MLP: a feedforward network with a single hidden layer and enough neurons can approximate any continuous function on a compact set to arbitrary accuracy. The value of this theorem is that it establishes "it can be done structurally", but it does not guarantee learnability with finite samples, nor a reasonable number of parameters, so in practice the long-standing experience that depth beats width holds.
Training relies on backpropagation to compute gradients, which are then used by optimizers such as SGD and Adam to update the parameters; the trainability of multi-layer networks also depends on engineering measures such as ReLU, Xavier and He initialization, BatchNorm and residual connections.
Key Points
Evolution of activation functions: early work used sigmoid and tanh, both of which enter a saturation region when the absolute value of the input is large, with derivatives approaching zero, so the error signal decays rapidly after being multiplied across layers, which is the main reason deep networks could not be trained. Around 2010 ReLU became mainstream; its gradient is constantly 1 on the positive half-axis, it neither saturates nor requires exponential computation, and convergence speed improved markedly, at the cost that the dead zone on the negative half-axis may permanently deactivate some neurons, which is exactly why Leaky ReLU and GELU were introduced as improvements. Among them GELU weights the activation by the Gaussian cumulative distribution and has a smooth shape, and it is widely adopted by the BERT and GPT families.
Parameter counting: the number of parameters in each layer is the input dimension times the output dimension plus the bias. A three-layer MLP of 784, 512, 256 and 10 has about 530,000 parameters; parameter size grows with the square of width, so widening without limit is not feasible.
Universal approximation is not optimality: the MLP flattens all structural information into a long vector and then multiplies and adds element by element; the local correlation of adjacent pixels in an image and the ordering of words in text are both erased at this step. Relearning visual and linguistic structure from such inputs requires massive samples and parameters, which is the fundamental reason convolutional and recurrent networks exist. The MLP has an extremely weak inductive bias, which is exactly why it is universal yet inefficient: being able to represent everything means assuming nothing, and it is the most data-hungry to learn.
MLP-Mixer and the return of the MLP: MLP-Mixer, proposed by Google in 2021, uses only fully connected layers and transposes to perform image recognition, and at medium data scale it can compete with convolutional networks and ViT, suggesting that when data are abundant a weak inductive bias can be compensated by scale.
Common Misconceptions
Misconception one: that "the more layers the better". An overly deep MLP suffers from vanishing or exploding gradients and degradation problems and cannot be trained to an effective solution. Misconception two: confusing the MLP with all of deep learning. The MLP contains no structural designs such as convolution or attention, and it is sample-inefficient on vision and long-sequence tasks. Misconception three: thinking the universal approximation theorem means omnipotence; in fact it discusses existence, not learnability or generalization.
Application Scenarios
Classification and regression on tabular data, feature crossing in recommendation systems, the feedforward sublayer in Transformers, baseline models for time series forecasting, anomaly detection, simple baselines for image classification, policy networks in reinforcement learning, and coordinate encoding networks in neural radiance fields.