AI & LLMs

Autoencoder

A network trained to reconstruct its input through a narrow bottleneck, learning a compressed representation.

An autoencoder is a neural network trained to copy its input to its output through a narrow middle layer (the bottleneck), forcing it to learn a compressed representation — an encoder squeezes the input into a latent code, a decoder reconstructs it. It learns structure without labels.

Worked example: train an autoencoder on normal machine sensor readings; it reconstructs them well, but a faulty reading reconstructs poorly (high error) — so reconstruction error becomes an anomaly detector, with no labeled faults needed. Gotcha: a plain autoencoder’s latent space is not structured for generation (sampling a random code gives garbage) — the variational autoencoder (VAE) fixes that by making the latent space smooth and samplable, which is why VAEs, not plain autoencoders, feed generative pipelines like latent diffusion.