What is SwiGLU and why do LLMs use it in the MLP block?
hardAnswer
- SwiGLU (Shazeer 2020, adopted by PaLM, LLaMA, Mistral) replaces the standard MLP with .
- The gated activation adds a multiplicative branch that lets the network selectively pass information.
- Modest params overhead (~1.5x MLP), small but consistent quality gains (~1-2% perplexity).
- Standard in all 2023+ open LLMs.
Check yourself — multiple choice
- Same as GELU MLP
- Gated activation · — small quality gain, standard in modern LLMs
- SwiGLU removes MLP
- Only for CNNs
SwiGLU: gated SiLU MLP → small consistent quality gain, standard since PaLM.
#architecture#fundamentals
Practise LLMs & GenAI
214 interview questions in this topic.
Related questions
- Why do modern LLMs use decoder-only architectures?
- What is a large language model, in one paragraph?
- What is the context window and what tricks extend it?
- What is a Mixture-of-Experts (MoE) LLM?
- Walk through how one training step of an autoregressive LLM works.
- How does Byte-Pair Encoding (BPE) tokenization work?