# Activation Function

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

## What is Activation Function?

**In one sentence:** An activation function decides how strongly a neuron "fires" by transforming its total input into its output.

Without activation functions, stacking layers would be pointless, because the whole network would act like one simple straight-line formula. Activation functions add curves and bends, letting networks learn complicated patterns.

![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 Activation Function?

ReLU, a common activation function, turns negative numbers into 0 and keeps positive numbers the same.

## Why does Activation Function matter?

Activation functions are what let neural networks learn complex things like language and images.

## Related Concepts

- [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.
- [ReLU](https://getaimath.com/dictionary/relu/): ReLU is a simple activation function that outputs 0 for any negative number and leaves positive numbers unchanged.
- [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.
- [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.
- [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.
- [SwiGLU](https://getaimath.com/dictionary/swiglu/): SwiGLU is an activation design used in many modern LLMs that adds a "gate" so the network can control how much information passes.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/activation-function/)
