Autoencoder
Last Updated: July 29, 2026 | By Mihail Sebastian | AI Dictionary
A neural network that compresses data through a narrow bottleneck and reconstructs it; the compact code it learns drives denoising and anomaly detection.
What is an Autoencoder?
An autoencoder is a neural network trained to compress its input into a small internal code and then reconstruct the original from that code alone.
The compression is the point. To rebuild a face, a sensor reading, or a transaction from a code a fraction of its size, the network must learn which structure is essential and which detail is noise. It learns this from raw data, without labels, which makes it a staple of unsupervised learning.
How an Autoencoder Works
An encoder squeezes the input down to the bottleneck code; a decoder expands the code back to full size. Training minimizes reconstruction error, the gap between the input and the rebuilt output. The bottleneck code itself is useful on its own, as a learned form of dimensionality reduction.
Variants adjust the recipe for particular jobs. A denoising autoencoder receives corrupted input and must output the clean version. A sparse autoencoder restricts how much of the code activates at once, which sharpens the features it extracts.
Autoencoder vs Variational Autoencoder
The practical difference: an autoencoder compresses data, a variational autoencoder generates it. A standard autoencoder maps each input to one fixed point in latent space, which is ideal for reconstruction but leaves the space between points meaningless; sampling there produces junk. A VAE encodes each input as a probability distribution instead, which fills the space smoothly, so sampling from it decodes into coherent new data.
| Criterion | Autoencoder | Variational Autoencoder |
|---|---|---|
| Latent code | One fixed point per input | A probability distribution per input |
| Main use | Compression, denoising, anomaly detection | Generating new data |
| Same input twice | Identical output | Output varies with each sample |
| Training objective | Reconstruction error only | Reconstruction error plus a term that keeps the latent space smooth |
Example of an Autoencoder
A bank trains an autoencoder on millions of legitimate card transactions. The network learns to reconstruct normal spending patterns with tiny error, because normal is all it has ever seen.
Then a stolen card starts buying gift cards at 3 a.m. in another country. The autoencoder fails to reconstruct the pattern, reconstruction error spikes, and the transaction is flagged for review. This is anomaly detection by reconstruction: the model never saw labeled fraud, only enough normality to notice its absence.
Related AI terms: Variational Autoencoder · Latent Space · Dimensionality Reduction · Anomaly Detection · Unsupervised Learning
Did you like the Autoencoder gist?
Learn about 250+ need-to-know artificial intelligence terms in the AI Dictionary.
Mihail Sebastian — Writes about AI governance, regulation, and the technology behind them. Placeholder bio — replace with a real credential line. About