AI & ML Atlas
Deep LearningarchitectureAnimated walkthrough
Sparse Autoencoders
An autoencoder in which only a few hidden units may be active at once.
The idea
A sparsity penalty (L1 or a KL term toward a small target activation) makes most hidden units stay near zero for any input. The code can be wider than the input yet each unit specialises in a particular feature. Recent interpretability work uses sparse autoencoders to find features inside large language models.
loss = ‖x − x̂‖² + λ·‖h‖₁
Watch it run
The pipeline lights up one step at a time. Use the controls to pause or step through it.
- 1Encode into a hidden layer (can be wider than the input).
- 2Penalise hidden activity to encourage sparsity.
- 3Decode and compute reconstruction error.
- 4Minimise reconstruction error plus the sparsity penalty.
loss = ‖x − x̂‖² + λ·‖h‖₁
1/4
Step by step
- 1Encode into a hidden layer (can be wider than the input).
- 2Penalise hidden activity to encourage sparsity.
- 3Decode and compute reconstruction error.
- 4Minimise reconstruction error plus the sparsity penalty.
Where it is used
Feature learning, interpretability of neural networks.
Watch out for
The penalty strength has to be tuned to avoid dead units.