# Feed-Forward Network (FFN)

- **Canonical URL:** https://getaimath.com/dictionary/feed-forward-network-ffn/
- **Topics:** [Transformer Architecture](https://getaimath.com/dictionary/category/transformer-architecture/)
- **Last updated:** 2026-11-25

## What is Feed-Forward Network (FFN)?

**In one sentence:** A feed-forward network is the part of each Transformer block that processes each token on its own after attention.

Attention mixes information between tokens. Then the FFN works on each token separately, like a little thinking step that transforms its meaning. It usually expands the numbers to a bigger size, applies an activation function, and shrinks them back. Much of a model's stored knowledge lives in these layers.

![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 Feed-Forward Network (FFN)?

After attention links "Paris" to "capital," the FFN might help bring up facts like "France" and "Eiffel Tower."

## Why does Feed-Forward Network (FFN) matter?

FFN layers hold most of a Transformer's parameters, so they matter a lot for size and knowledge.

## Related Concepts

- [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.
- [Multi-Layer Perceptron (MLP)](https://getaimath.com/dictionary/multi-layer-perceptron-mlp/): 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.
- [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.
- [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.
- [Positional Encoding](https://getaimath.com/dictionary/positional-encoding/): Positional encoding adds information about word order, so the model knows which word came first, second, and so on.
- [ReLU](https://getaimath.com/dictionary/relu/): ReLU is a simple activation function that outputs 0 for any negative number and leaves positive numbers unchanged.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/feed-forward-network-ffn/)
