# MoE Layer

- **Canonical URL:** https://getaimath.com/dictionary/moe-layer/
- **Topics:** [Mixture of Experts (MoE)](https://getaimath.com/dictionary/category/mixture-of-experts-moe/)
- **Last updated:** 2026-11-25

## What is MoE Layer?

**In one sentence:** An MoE layer is a layer that replaces a normal feed-forward network with a router and a group of experts.

In most MoE Transformers, attention stays the same, but the feed-forward part becomes an MoE layer. Some models use MoE in every layer; others alternate with normal layers.

![Mixture of Experts (MoE): A Team of Specialists (Only 2 Wake Up) — Simple cartoon showing a question arriving at a Front Desk Receptionist (Router) who wakes up only 2 out of 8 specialist doctors (Math and Finance) while the other 6 specialists stay asleep to save energy.](https://getaimath.com/diagrams/mixture-of-experts-moe.png)
*Napkin Diagram (Mixture of Experts (MoE)): Mixture-of-Experts wakes up only 2 of its 8 specialists for each word (real experts’ specialties are messier than neat topics).*

## What is an example of MoE Layer?

A Transformer block with attention followed by a router choosing 2 of 16 experts contains an MoE layer.

## Why does MoE Layer matter?

MoE layers are where the "mixture" in Mixture of Experts happens.

## Related Concepts

- [Conditional Computation](https://getaimath.com/dictionary/conditional-computation/): Conditional computation means the model decides which parts of itself to use based on the input.
- [Fine-Grained Experts](https://getaimath.com/dictionary/fine-grained-experts/): Fine-grained experts are many small experts instead of a few big ones, allowing more precise specialization.
- [Dense vs Sparse Architecture](https://getaimath.com/dictionary/dense-vs-sparse-architecture/): Dense vs sparse architecture compares models that use all parameters for every token with models that only use some.
- [Expert Communication](https://getaimath.com/dictionary/expert-communication/): Expert communication is the data sent between GPUs when tokens travel to the experts they need and back.
- [Expert Parallelism](https://getaimath.com/dictionary/expert-parallelism/): Expert parallelism spreads the experts of an MoE model across different GPUs, so each GPU holds and runs some of the experts.
- [Auxiliary Loss](https://getaimath.com/dictionary/auxiliary-loss/): An auxiliary loss is an extra training penalty added to encourage a side goal, such as balancing work across experts.

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