Autoencoders
A neural network that learns by squeezing its input through a bottleneck and rebuilding it, uncovering the essential structure of the data. From dimensionality reduction to anomaly detection and the generative VAE.
An autoencoder is a neural network trained to reconstruct its own input. Rather than predicting an external label, it simply tries to copy whatever it receives back to the output, with one deliberate catch: along the way the data must squeeze through a bottleneck, a middle layer far smaller than the input. That constraint stops the network from memorizing and forces it to keep only what matters.
Because the target signal is the input itself, no human labels are needed. This is self-supervised (or unsupervised) learning, guided by a single reconstruction error, usually the mean squared difference between input and output.
Encoder, decoder and the latent code
Every autoencoder has two halves. The encoder compresses the input into a lower-dimensional representation, the so-called code or latent vector. The decoder runs the process backward, rebuilding the original input from that code. If the reconstruction is faithful despite passing through a narrow space, the code has captured the essential structure of the data. In 2006, Geoffrey Hinton and Ruslan Salakhutdinov showed in Science that deep autoencoders could learn low-dimensional codes far more useful than those from principal component analysis (PCA).
What they are good for: dimensionality reduction, denoising and anomalies
Their most classic use is dimensionality reduction: as a nonlinear relative of PCA, an autoencoder projects complex data onto a handful of variables to compress or visualize it. A well-known variant, the denoising autoencoder, is trained on deliberately corrupted inputs and learns to return the clean version; Pascal Vincent and colleagues formalized it in 2008. For anomaly detection, an autoencoder can be trained on examples treated as normal and turn reconstruction error into a score. A reproducible Keras example sets a threshold and flags sequences above it; a study of industrial cooling systems uses total and per-sensor error to detect and localize faults. The premise needs testing: an over-capable autoencoder may reconstruct anomalies too, while a high error can reflect noise or distribution shift. The threshold and false-alarm rate must be validated in the domain; training alone does not make “unusual” synonymous with fraud or failure. Dimensionality reduction and anomaly detection each have their own entry in this glossary.
The generative variant: the variational autoencoder
The classic autoencoder compresses, but it is not designed to invent new data. That ability arrived with the variational autoencoder (VAE), proposed by Diederik Kingma and Max Welling in 2013. Instead of a single code, its encoder learns an entire probability distribution over the latent space; by sampling from it, the decoder produces plausible examples that were never in the original data. That is why the VAE is considered a generative model, kin to GANs, and earns its own entry in this glossary. Nearly two decades on, autoencoders remain one of the most elegant ideas in representation learning: teaching a machine to understand data by asking it, quite simply, to draw the data again.
Pieces using this term
- Anthropic maps 34 million features in Claude 3 Sonnet (2024-05-21)
- Preprocessing Without Leaking the Future: Fit and Transform (2023-05-09)
- Machine Learning in Cybersecurity: From Anomaly to Response (2023-05-09)
- Generative Models: What They Learn, Invent, and Get Wrong (2023-05-09)
- Learning Without Labels: How to Choose and Validate a Representation (2023-05-09)
This article was produced with artificial intelligence under human editorial oversight.