# Multi-Layer Perceptron (MLP)

- **Canonical URL:** https://getaimath.com/dictionary/multi-layer-perceptron-mlp/
- **Topics:** [Transformer Architecture](https://getaimath.com/dictionary/category/transformer-architecture/)
- **Last updated:** 2026-11-25

## What is Multi-Layer Perceptron (MLP)?

**In one sentence:** A multi-layer perceptron is a basic neural network made of layers of neurons where every neuron connects to every neuron in the next layer.

It is the classic neural network design: input layer, one or more hidden layers, and output layer. In Transformers, the feed-forward network is a small MLP, so people often use the two names for the same part.

![Transformers & Attention: The Smart Highlighter — Simple cartoon diagram showing how a Transformer reads a whole sentence at once and shines a bright highlighter beam from the word "IT" back to "trophy" so it knows what "IT" means.](https://getaimath.com/diagrams/transformer-architecture.png)
*Napkin Diagram (Transformer Architecture): Older AI read word-by-word and often lost track of earlier words; a Transformer highlights which words connect to which.*

## What is an example of Multi-Layer Perceptron (MLP)?

A simple MLP could take a student's study hours and sleep hours and predict their test score.

## Why does Multi-Layer Perceptron (MLP) matter?

MLPs are a basic building block found inside almost every modern AI model.

## Related Concepts

- [Feed-Forward Network (FFN)](https://getaimath.com/dictionary/feed-forward-network-ffn/): A feed-forward network is the part of each Transformer block that processes each token on its own after attention.
- [Activation Function](https://getaimath.com/dictionary/activation-function/): An activation function decides how strongly a neuron "fires" by transforming its total input into its output.
- [ALiBi](https://getaimath.com/dictionary/alibi/): ALiBi is a simple way of handling word position by adding a penalty to attention scores based on how far apart two words are.
- [ReLU](https://getaimath.com/dictionary/relu/): ReLU is a simple activation function that outputs 0 for any negative number and leaves positive numbers unchanged.
- [Rotary Positional Embedding (RoPE)](https://getaimath.com/dictionary/rotary-positional-embedding-rope/): RoPE is a popular way to tell a model about word positions by rotating its query and key numbers by an angle based on position.
- [GELU](https://getaimath.com/dictionary/gelu/): GELU is a smooth activation function that works like a softer ReLU, letting small negative values through a little.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/multi-layer-perceptron-mlp/)
